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

41 lines
1.0 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 = {
entry: './src/index.js',
output: {
path: path.resolve(__dirname, 'dist'),
filename: 'bundle.js'
},
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
}
}