From c76821687df91a6ec3ef0fa1b14e0153287633be Mon Sep 17 00:00:00 2001 From: Matthew Phillips Date: Fri, 19 Nov 2021 11:15:39 -0500 Subject: [PATCH] Remove further dependence on vite package (#1906) * Remove further dependence on vite package * Adds a changeset * Add graymatter as a regular dep --- .changeset/few-pumpkins-report.md | 5 +++++ packages/astro/vendor/vite/dist/node/chunks/dep-35df7f96.js | 4 ++-- packages/markdown/remark/package.json | 5 ++--- 3 files changed, 9 insertions(+), 5 deletions(-) create mode 100644 .changeset/few-pumpkins-report.md diff --git a/.changeset/few-pumpkins-report.md b/.changeset/few-pumpkins-report.md new file mode 100644 index 000000000..ec39673a1 --- /dev/null +++ b/.changeset/few-pumpkins-report.md @@ -0,0 +1,5 @@ +--- +'astro': patch +--- + +Fix build by making vendored vite resolve to copy diff --git a/packages/astro/vendor/vite/dist/node/chunks/dep-35df7f96.js b/packages/astro/vendor/vite/dist/node/chunks/dep-35df7f96.js index bdf7306ea..c709d599e 100644 --- a/packages/astro/vendor/vite/dist/node/chunks/dep-35df7f96.js +++ b/packages/astro/vendor/vite/dist/node/chunks/dep-35df7f96.js @@ -22469,7 +22469,7 @@ function terserPlugin(config) { // root with vite itself, so we have to pass in the basedir and resolve // terser first. // eslint-disable-next-line node/no-restricted-require - const terserPath = require.resolve('vite/dist/node/terser', { + const terserPath = require.resolve('../terser', { paths: [basedir] }); return require(terserPath).minify(code, options); @@ -43009,7 +43009,7 @@ async function doBuild(inlineConfig = {}) { const options = config.build; const ssr = !!options.ssr; const libOptions = options.lib; - config.logger.info(source.cyan(`vite v${require('vite/package.json').version} ${source.green(`building ${ssr ? `SSR bundle ` : ``}for ${config.mode}...`)}`)); + config.logger.info(source.cyan(`vite v${require('../../../package.json').version} ${source.green(`building ${ssr ? `SSR bundle ` : ``}for ${config.mode}...`)}`)); const resolve = (p) => path__default.resolve(config.root, p); const input = libOptions ? resolve(libOptions.entry) diff --git a/packages/markdown/remark/package.json b/packages/markdown/remark/package.json index 3b411614b..8ee0fe545 100644 --- a/packages/markdown/remark/package.json +++ b/packages/markdown/remark/package.json @@ -22,6 +22,7 @@ "@silvenon/remark-smartypants": "^1.0.0", "assert": "^2.0.0", "github-slugger": "^1.3.0", + "gray-matter": "^4.0.3", "mdast-util-mdx-expression": "^1.1.1", "mdast-util-mdx-jsx": "^1.1.1", "micromark-extension-mdx-expression": "^1.0.0", @@ -38,10 +39,8 @@ "unist-util-map": "^3.0.0", "unist-util-visit": "^4.0.0" }, - "//": "Important that gray-matter is in devDependencies so it gets bundled by esbuild!", "devDependencies": { "@types/github-slugger": "^1.3.0", - "@types/prismjs": "^1.16.6", - "gray-matter": "^4.0.3" + "@types/prismjs": "^1.16.6" } }