Skip to content

Commit

Permalink
esbuild: prioritize "module" over "browser" (#37052)
Browse files Browse the repository at this point in the history
* Update esbuild mainFields for better tree shaking

* also update test runner
  • Loading branch information
samouri committed Nov 24, 2021
1 parent 4345078 commit b78e878
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions build-system/tasks/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -456,6 +456,7 @@ async function esbuildCompile(srcDir, srcFilename, destDir, options) {
incremental: !!options.watch,
logLevel: 'silent',
external: options.externalDependencies,
mainFields: ['module', 'browser', 'main'],
write: false,
});
} else {
Expand Down
1 change: 1 addition & 0 deletions build-system/tasks/runtime-test/runtime-test-base.js
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,7 @@ class RuntimeTestConfig {
'process.env.NODE_ENV': '"test"',
},
plugins: [importPathPlugin, babelPlugin],
mainFields: ['module', 'browser', 'main'],
sourcemap: 'inline',
};
}
Expand Down

0 comments on commit b78e878

Please sign in to comment.