Remove further dependence on vite package (#1906)

* Remove further dependence on vite package

* Adds a changeset

* Add graymatter as a regular dep
This commit is contained in:
Matthew Phillips 2021-11-19 11:15:39 -05:00 committed by GitHub
parent 05a2c48449
commit c76821687d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 5 deletions

View file

@ -0,0 +1,5 @@
---
'astro': patch
---
Fix build by making vendored vite resolve to copy

View file

@ -22469,7 +22469,7 @@ function terserPlugin(config) {
// root with vite itself, so we have to pass in the basedir and resolve // root with vite itself, so we have to pass in the basedir and resolve
// terser first. // terser first.
// eslint-disable-next-line node/no-restricted-require // eslint-disable-next-line node/no-restricted-require
const terserPath = require.resolve('vite/dist/node/terser', { const terserPath = require.resolve('../terser', {
paths: [basedir] paths: [basedir]
}); });
return require(terserPath).minify(code, options); return require(terserPath).minify(code, options);
@ -43009,7 +43009,7 @@ async function doBuild(inlineConfig = {}) {
const options = config.build; const options = config.build;
const ssr = !!options.ssr; const ssr = !!options.ssr;
const libOptions = options.lib; 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 resolve = (p) => path__default.resolve(config.root, p);
const input = libOptions const input = libOptions
? resolve(libOptions.entry) ? resolve(libOptions.entry)

View file

@ -22,6 +22,7 @@
"@silvenon/remark-smartypants": "^1.0.0", "@silvenon/remark-smartypants": "^1.0.0",
"assert": "^2.0.0", "assert": "^2.0.0",
"github-slugger": "^1.3.0", "github-slugger": "^1.3.0",
"gray-matter": "^4.0.3",
"mdast-util-mdx-expression": "^1.1.1", "mdast-util-mdx-expression": "^1.1.1",
"mdast-util-mdx-jsx": "^1.1.1", "mdast-util-mdx-jsx": "^1.1.1",
"micromark-extension-mdx-expression": "^1.0.0", "micromark-extension-mdx-expression": "^1.0.0",
@ -38,10 +39,8 @@
"unist-util-map": "^3.0.0", "unist-util-map": "^3.0.0",
"unist-util-visit": "^4.0.0" "unist-util-visit": "^4.0.0"
}, },
"//": "Important that gray-matter is in devDependencies so it gets bundled by esbuild!",
"devDependencies": { "devDependencies": {
"@types/github-slugger": "^1.3.0", "@types/github-slugger": "^1.3.0",
"@types/prismjs": "^1.16.6", "@types/prismjs": "^1.16.6"
"gray-matter": "^4.0.3"
} }
} }