assassin-bug/webpack.config.js

42 lines
926 B
JavaScript
Raw Normal View History

2021-11-03 11:08:40 +00:00
const path = require('path');
const CopyWebpackPlugin = require('copy-webpack-plugin');
const HTMLWebpackPlugin = require('html-webpack-plugin');
2021-11-04 19:58:37 +00:00
const TerserWebpackPlugin = require('terser-webpack-plugin');
2021-11-03 11:08:40 +00:00
const Package = require('./package');
module.exports = {
entry: './src/game/index.js',
devtool: 'inline-source-map',
performance: {
2021-11-05 13:28:01 +00:00
hints: false
2021-11-03 11:08:40 +00:00
},
2021-11-04 19:58:37 +00:00
optimization: {
minimizer: [new TerserWebpackPlugin()]
},
2021-11-03 11:08:40 +00:00
"plugins": [
2021-11-05 13:28:01 +00:00
new HTMLWebpackPlugin({
title: Package.name,
template: path.join(__dirname, "src/game/index.html")
}),
new CopyWebpackPlugin({
patterns: [
{ from: 'assets', to: 'assets' },
]
})
2021-11-03 11:08:40 +00:00
],
module: {
rules: [
{
test: /\.js?$/,
exclude: /node_modules/
}
]
},
resolve: {
2021-11-05 13:28:01 +00:00
extensions: ['.ts', '.js']
2021-11-03 11:08:40 +00:00
},
output: {
filename: 'game.js',
path: path.resolve(__dirname, 'app_web')
}
};