47 lines
1019 B
JavaScript
47 lines
1019 B
JavaScript
|
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: {
|
||
|
rules: [
|
||
|
{
|
||
|
test: /\.js$/,
|
||
|
loaders: ['babel-loader'],
|
||
|
exclude: [/node_modules/, /data/]
|
||
|
},
|
||
|
{
|
||
|
test: /\.css$/,
|
||
|
use: ['style-loader', 'css-loader']
|
||
|
},
|
||
|
{
|
||
|
test: /\.(png|jpg|gif)$/,
|
||
|
use: ['url-loader']
|
||
|
},
|
||
|
{
|
||
|
test: /\.wasm$/,
|
||
|
type: 'javascript/auto',
|
||
|
loader: 'file-loader',
|
||
|
options: {
|
||
|
name: '[name].[hash:5].[ext]'
|
||
|
}
|
||
|
}
|
||
|
]
|
||
|
},
|
||
|
plugins: [new CleanWebpackPlugin(), new CopyPlugin(['public'])],
|
||
|
devtool: 'source-map',
|
||
|
// to make webpack work with emscripten js files
|
||
|
target: 'web',
|
||
|
node: {
|
||
|
__dirname: false,
|
||
|
fs: 'empty',
|
||
|
Buffer: false,
|
||
|
process: false
|
||
|
}
|
||
|
}
|