Skip to content

Commit f74a142

Browse files
committed
Replace webpack.config.externals
By using `serverExternalPackages`, we should be ready for when we switch to Turbopack. (But we can't switch to Turbopack yet because, as far as I know, it doesn't support require.context yet, which we use for discovering FTL files.)
1 parent 0c6d0b7 commit f74a142

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

next.config.js

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -168,16 +168,13 @@ const nextConfig = {
168168
type: "asset/source",
169169
});
170170

171-
config.externals ??= {};
172-
config.externals.push({
173-
knex: "commonjs knex",
174-
});
175-
176171
return config;
177172
},
178-
// Without this setting, Next.js has Webpack trying and failing to load
173+
// Without adding MJML here, Next.js has Webpack trying and failing to load
179174
// uglify-js when compiling MJML email templates to HTML in `renderEmail.ts`:
180-
serverExternalPackages: ["mjml"],
175+
// commonjs and knex are needed to avoid errors about not being able to load
176+
// better-sqlite3, for some reason.
177+
serverExternalPackages: ["mjml", "commonjs", "knex"],
181178
};
182179

183180
const sentryOptions = {

0 commit comments

Comments
 (0)