30 lines
663 B
JavaScript
30 lines
663 B
JavaScript
|
const CopyWebpackPlugin = require('copy-webpack-plugin');
|
||
|
const config = require('./src/config');
|
||
|
|
||
|
module.exports = {
|
||
|
mode: config.debug ? 'development' : 'production',
|
||
|
entry: `${__dirname}/src/frontend/index.js`,
|
||
|
module: {
|
||
|
rules: [
|
||
|
{
|
||
|
test: /\.js$/,
|
||
|
exclude: /node_modules/,
|
||
|
loader: 'babel-loader',
|
||
|
},
|
||
|
],
|
||
|
},
|
||
|
output: {
|
||
|
filename: 'index.js',
|
||
|
path: `${__dirname}/public`,
|
||
|
publicPath: '/',
|
||
|
},
|
||
|
plugins: [
|
||
|
new CopyWebpackPlugin({
|
||
|
patterns: [
|
||
|
{ from: 'node_modules/xterm/css', to: 'xterm/css' },
|
||
|
{ from: 'node_modules/xterm/lib', to: 'xterm/lib' },
|
||
|
],
|
||
|
}),
|
||
|
],
|
||
|
};
|