Skip to content

Commit

Permalink
Merge pull request #449 from nextcloud/fix/noid/do-not-polyfill-avail…
Browse files Browse the repository at this point in the history
…able-in-browser-node-modules
  • Loading branch information
skjnldsv authored Apr 18, 2023
2 parents 702973a + 9f612ef commit 90ed4a7
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions webpack.config.js
Original file line number Diff line number Diff line change
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

0 comments on commit 90ed4a7

Please sign in to comment.