Skip to content

Commit

Permalink
Updated webpack production configs
Browse files Browse the repository at this point in the history
  • Loading branch information
Bianca Wentzel committed Aug 30, 2024
1 parent 476e92f commit 76b0665
Showing 1 changed file with 25 additions and 1 deletion.
26 changes: 25 additions & 1 deletion webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,31 @@ if (["build", "dev"].includes(process.env.npm_lifecycle_event)) {
});
} else {
// production
config = merge(prodConfig(), baseConfig(), { node: { __dirname: true } });
config = merge(
prodConfig(),
baseConfig(),
{ node: { __dirname: true } },
{
plugins: [
new Dotenv(),
// Work around for Buffer is undefined:
// https://github.com/webpack/changelog-v5/issues/10
new webpack.ProvidePlugin({
Buffer: ["buffer", "Buffer"],
}),
new webpack.ProvidePlugin({
process: "process/browser",
}),
]
},
{
resolve: {
fallback: {
stream: require.resolve("stream-browserify"),
buffer: require.resolve("buffer"),
},
},
});
}

module.exports = config;

0 comments on commit 76b0665

Please sign in to comment.