Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions packages/remix-dev/compiler/compileBrowser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import { emptyModulesPlugin } from "./plugins/emptyModulesPlugin";
import { mdxPlugin } from "./plugins/mdx";
import { urlImportsPlugin } from "./plugins/urlImportsPlugin";
import { writeFileSafe } from "./utils/fs";
import invariant from "../invariant";

export type BrowserCompiler = {
// produce ./public/build/
Expand Down Expand Up @@ -70,7 +71,7 @@ const createEsbuildConfig = (
entryPoints[id] = config.routes[id].file + "?browser";
}

let plugins = [
let plugins: esbuild.Plugin[] = [
deprecatedRemixPackagePlugin(options.onWarning),
cssFilePlugin(options),
urlImportsPlugin(),
Expand Down Expand Up @@ -128,9 +129,12 @@ export const createBrowserCompiler = (
metafile: true,
incremental: true,
});
metafile = compiler.metafile!;
invariant(compiler.metafile, "Expected metafile to be defined");
metafile = compiler.metafile;
} else {
metafile = (await compiler.rebuild()).metafile!;
let rebuild = await compiler.rebuild();
invariant(rebuild.metafile, "Expected metafile to be defined");
metafile = rebuild.metafile;
}
let manifest = await createAssetsManifest(remixConfig, metafile);
manifestChannel.write(manifest);
Expand Down
2 changes: 1 addition & 1 deletion packages/remix-dev/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"chalk": "^4.1.2",
"chokidar": "^3.5.1",
"dotenv": "^16.0.0",
"esbuild": "0.15.12",
"esbuild": "0.16.3",
"execa": "5.1.1",
"exit-hook": "2.2.1",
"express": "^4.17.1",
Expand Down
Loading