-
Notifications
You must be signed in to change notification settings - Fork 145
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
Bump os-locale (add support for ESM dependencies) #5415
base: master
Are you sure you want to change the base?
Changes from all commits
19ecc75
1fe253a
852ebaa
f047edc
83729b7
49fd6a7
b4543d5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,14 +6,19 @@ const webpack = require('webpack'); | |
// eslint-disable-next-line import/no-extraneous-dependencies | ||
const nodeExternals = require('webpack-node-externals'); | ||
|
||
// ESM packages must be bundled because webpack will otherwise turn `require()` into `import()` | ||
// and make the import silently asynchronous. In most cases this breaks the import. | ||
const dependenciesToBundle = [ | ||
'os-locale', // Used exclusively in sync functions | ||
]; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As expected, there's "no way" to So this is the alternative: do not keep |
||
|
||
module.exports = { | ||
// Set the webpack4 mode 'none' for compatibility with the behavior of the | ||
// webpack3 bundling step. | ||
mode: 'none', | ||
entry: { | ||
'addons-linter': './src/main.js', | ||
}, | ||
target: 'node', | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Webpack defaults to browserlist, if set. We have it already and it's set to |
||
output: { | ||
filename: '[name].js', | ||
libraryTarget: 'commonjs2', | ||
|
@@ -38,6 +43,7 @@ module.exports = { | |
externals: [ | ||
nodeExternals({ | ||
modulesFromFile: true, | ||
allowlist: dependenciesToBundle, | ||
}), | ||
], | ||
plugins: [ | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Standard config for ESM packages