diff options
author | 2021-07-12 17:01:33 -0500 | |
---|---|---|
committer | 2021-07-12 17:01:33 -0500 | |
commit | 7583a8b42a6db44ca589398dba0cd9fe53643bef (patch) | |
tree | c80050f51c748285bccd0355612bfa7b86465f00 /scripts | |
parent | 9859f53903f51f42fbe00bd7d3b160bcafb06b8f (diff) | |
download | astro-7583a8b42a6db44ca589398dba0cd9fe53643bef.tar.gz astro-7583a8b42a6db44ca589398dba0cd9fe53643bef.tar.zst astro-7583a8b42a6db44ca589398dba0cd9fe53643bef.zip |
Update build script to avoid bundling (#304)
* fix: simplify astro-scripts build
* fix: remove source-map-support, add missing `.js` extensions
* refactor: use `module` for `@astrojs/markdown-support`
* fix: missing `.js` extension
* fix: missed @astrojs/parser
* fix: remove old file
* fix: merge conflict
* fix: CJS weirdness
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/cmd/build.js | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/scripts/cmd/build.js b/scripts/cmd/build.js index dd2b2fd82..27941b514 100644 --- a/scripts/cmd/build.js +++ b/scripts/cmd/build.js @@ -7,11 +7,10 @@ import glob from 'tiny-glob'; /** @type {import('esbuild').BuildOptions} */ const defaultConfig = { - bundle: true, minify: false, format: 'esm', platform: 'node', - target: 'node14', + target: 'node14.16.1', sourcemap: 'inline', sourcesContent: false, }; @@ -26,16 +25,15 @@ export default async function build(...args) { const { type = 'module', dependencies = {} } = await fs.readFile('./package.json').then((res) => JSON.parse(res.toString())); const format = type === 'module' ? 'esm' : 'cjs'; - const external = [...Object.keys(dependencies), '@astrojs/language-server/bin/server.js', 'source-map-support', 'source-map-support/register.js', 'vscode']; const outdir = 'dist'; await clean(outdir); if (!isDev) { await esbuild.build({ ...config, + bundle: entryPoints.length === 1, // Note: only use `bundle` with a single entrypoint! entryPoints, outdir, - external, format, plugins: [svelte({ isDev })], }); |