Skip to content

Commit 78141a3

Browse files
fix: proritize server builds over browser for packages
This PR prioritizes the `module` and `main` fields over the `browser` field, which Webpack uses by default, but is often incompatible with Node.
1 parent b26f1a1 commit 78141a3

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/build.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,8 @@ function webpackConfig(dir, {userWebpackConfig, useBabelrc} = {}) {
7777
var webpackConfig = {
7878
mode: webpackMode,
7979
resolve: {
80-
extensions: ['.wasm', '.mjs', '.js', '.json', '.ts']
80+
extensions: ['.wasm', '.mjs', '.js', '.json', '.ts'],
81+
mainFields: ['module', 'main']
8182
},
8283
module: {
8384
rules: [

0 commit comments

Comments
 (0)