Skip to content

Commit

Permalink
chore(build): exclude graceful-fs from the sys/node/index.js bundle (#…
Browse files Browse the repository at this point in the history
…5647)

This uses the `externalAlias` plugin to 'externalize' the
`graceful-fs` package from our `sys/node/index.js` bundle while also
aliasing it to the file that we ship as part of the Stencil package at
`sys/node/graceful-fs.js`.

We did a similar thing in #5625

STENCIL-1268
  • Loading branch information
alicewriteswrongs committed Apr 12, 2024
1 parent c3e46ea commit 55d8e2f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion scripts/esbuild/sys-node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { sysNodeExternalBundles } from '../bundles/sys-node';
import { getBanner } from '../utils/banner';
import type { BuildOptions } from '../utils/options';
import { writePkgJson } from '../utils/write-pkg-json';
import { getBaseEsbuildOptions, getEsbuildAliases, getEsbuildExternalModules, runBuilds } from './util';
import { externalAlias, getBaseEsbuildOptions, getEsbuildAliases, getEsbuildExternalModules, runBuilds } from './util';

export async function buildSysNode(opts: BuildOptions) {
const inputDir = join(opts.buildDir, 'sys', 'node');
Expand Down Expand Up @@ -52,6 +52,7 @@ export async function buildSysNode(opts: BuildOptions) {
minify: true,
alias: sysNodeAliases,
banner: { js: getBanner(opts, `Stencil Node System`, true) },
plugins: [externalAlias('graceful-fs', './graceful-fs.js')],
};

// sys/node/worker.js bundle
Expand Down

0 comments on commit 55d8e2f

Please sign in to comment.