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

Do not polyfill available in a web browser Node modules #449

Merged
Merged
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
11 changes: 7 additions & 4 deletions webpack.config.js
Expand Up @@ -46,7 +46,7 @@ module.exports = {
output: {
path: path.resolve('./js'),
publicPath: path.join('/apps/', appName, '/js/'),

// Output file names
filename: `${appName}-[name].js?v=[contenthash]`,
chunkFilename: `${appName}-[name].js?v=[contenthash]`,
Expand Down Expand Up @@ -78,9 +78,9 @@ module.exports = {
'Access-Control-Allow-Origin': '*',
},
},

cache: !isDev,

optimization: {
chunkIds: 'named',
splitChunks: {
Expand Down Expand Up @@ -108,7 +108,10 @@ module.exports = {

// Make sure we auto-inject node polyfills on demand
// https://webpack.js.org/blog/2020-10-10-webpack-5-release/#automatic-nodejs-polyfills-removed
new NodePolyfillPlugin(),
new NodePolyfillPlugin({
// These modules available in the web-browser
excludeAliases: ['console', 'Buffer'],
}),

// Make appName & appVersion available as a constant
new webpack.DefinePlugin({ appName: JSON.stringify(appName) }),
Expand Down