Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

esbuild: prioritize "module" over "browser" #37052

Merged
merged 2 commits into from
Nov 24, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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'],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's update the test running with this, too.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What test?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All of them:

this.esbuild = {
target: 'es5',
define: {
'process.env.NODE_DEBUG': 'false',
'process.env.NODE_ENV': '"test"',
},
plugins: [importPathPlugin, babelPlugin],
sourcemap: 'inline',
};

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, forgot about this. Sure

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