Skip to content

Commit

Permalink
chore(dev): exit when using fake built ins (remix-run#321)
Browse files Browse the repository at this point in the history
  • Loading branch information
mcansh authored Oct 22, 2021
1 parent fdebb4a commit 1ad266c
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions packages/remix-dev/compiler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,16 @@ async function createBrowserBuild(
// on node built-ins in browser bundles.
let dependencies = Object.keys(await getAppDependencies(config));
let externals = nodeBuiltins.filter(mod => !dependencies.includes(mod));
let fakeBuiltins = nodeBuiltins.filter(mod => dependencies.includes(mod));

if (fakeBuiltins.length > 0) {
console.error(
`It appears you're using a module that is built in to node, but you installed it as a dependency which could cause problems. Please remove ${fakeBuiltins.join(
", "
)} before continuing.`
);
process.exit(1);
}

let entryPoints: esbuild.BuildOptions["entryPoints"] = {
"entry.client": path.resolve(config.appDirectory, config.entryClientFile)
Expand Down

0 comments on commit 1ad266c

Please sign in to comment.