2023-10-03 15:43:35 +00:00
|
|
|
const path = require('path');
|
2024-10-17 15:02:51 +00:00
|
|
|
const webpack = require('webpack');
|
2023-10-03 15:43:35 +00:00
|
|
|
|
|
|
|
module.exports = {
|
|
|
|
entry: './src/index.js',
|
|
|
|
output: {
|
|
|
|
filename: 'bundle.js',
|
|
|
|
path: path.resolve(__dirname, 'generated'),
|
|
|
|
module: true,
|
|
|
|
//clean: true,
|
|
|
|
},
|
|
|
|
devServer: {
|
|
|
|
static: path.join(__dirname, "."),
|
|
|
|
compress: true,
|
|
|
|
port: 9000,
|
|
|
|
client: {
|
|
|
|
overlay: false,
|
|
|
|
}
|
|
|
|
},
|
|
|
|
experiments: {
|
|
|
|
outputModule: true,
|
|
|
|
},
|
2024-10-17 15:02:51 +00:00
|
|
|
plugins: [
|
|
|
|
// Work around for Buffer is undefined:
|
|
|
|
// https://github.com/webpack/changelog-v5/issues/10
|
|
|
|
new webpack.ProvidePlugin({
|
|
|
|
Buffer: ['buffer', 'Buffer'],
|
|
|
|
})
|
|
|
|
],
|
|
|
|
resolve: {
|
|
|
|
extensions: [ '.ts', '.js' ],
|
|
|
|
fallback: {
|
|
|
|
buffer: require.resolve("buffer"),
|
|
|
|
},
|
|
|
|
},
|
2023-10-03 15:43:35 +00:00
|
|
|
};
|