mt-polygon-simplification/benchmarking/webpack.config.js

44 lines
1.1 KiB
JavaScript
Raw Normal View History

2019-07-14 20:37:26 +02:00
const { CleanWebpackPlugin } = require('clean-webpack-plugin')
const CopyPlugin = require('copy-webpack-plugin')
const path = require('path')
module.exports = {
2019-08-06 14:03:05 +02:00
entry: {
bundle: './src/index.js',
loadChart: './src/loadChart.js'
},
2019-07-14 20:37:26 +02:00
output: {
path: path.resolve(__dirname, 'dist'),
2019-08-06 14:03:05 +02:00
filename: '[name].js'
2019-07-14 20:37:26 +02:00
},
module: {
// Suppress warnings and errors logged by benchmark.js when bundled using webpack.
noParse: [path.resolve(__dirname, './node_modules/benchmark/benchmark.js')],
rules: [
{
test: /\.js$/,
loaders: ['babel-loader'],
exclude: [/node_modules/, /data/]
},
{
test: /\.wasm$/,
type: 'javascript/auto',
loader: 'file-loader',
options: {
name: '[name].[hash:5].[ext]'
}
}
]
},
plugins: [new CleanWebpackPlugin(), new CopyPlugin([{ from: 'public' }])],
devtool: 'source-map',
// to make webpack work with emscripten js files
target: 'web',
node: {
__dirname: false,
fs: 'empty',
Buffer: false,
process: false
}
}