chore(build): update build script to not bundle "dependencies"

This commit is contained in:
Nate Moore 2021-10-07 17:15:22 -05:00
parent b9ea9284e7
commit b89fffc2ed

View file

@ -30,9 +30,12 @@ export default async function build(...args) {
const outdir = 'dist'; const outdir = 'dist';
await clean(outdir); await clean(outdir);
const external = Object.keys(dependencies);
if (!isDev) { if (!isDev) {
await esbuild.build({ await esbuild.build({
...config, ...config,
external,
bundle: entryPoints.length === 1, // Note: only use `bundle` with a single entrypoint! bundle: entryPoints.length === 1, // Note: only use `bundle` with a single entrypoint!
entryPoints, entryPoints,
outdir, outdir,
@ -44,6 +47,7 @@ export default async function build(...args) {
const builder = await esbuild.build({ const builder = await esbuild.build({
...config, ...config,
external,
watch: { watch: {
onRebuild(error, result) { onRebuild(error, result) {
const date = new Date().toISOString(); const date = new Date().toISOString();