forked from FreezingMoon/AncientBeast
-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
49 lines (46 loc) · 1.03 KB
/
webpack.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
const path = require('path');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const settings = {
entry: path.resolve(__dirname, 'src', 'script.js'),
output: {
path: path.resolve(__dirname, 'deploy/'),
filename: 'ancientbeast.js',
publicPath: '/'
},
devtool: 'inline-source-map',
optimization: {
splitChunks: {
cacheGroups: {}
}
},
module: {
rules: [
{
test: /\.less$/,
use: ['style-loader', 'css-loader', 'less-loader']
},
{
test: /\.css$/,
use: ['style-loader', 'css-loader']
},
{
test: /\.(png|jpg|gif|svg|ogg|ico|cur|woff|woff2)$/,
use: ['file-loader']
}
]
},
resolve: {
alias: {
assets: path.resolve(__dirname, 'assets/'),
modules: path.join(__dirname, 'node_modules')
}
},
plugins: [
new HtmlWebpackPlugin({
template: path.resolve(__dirname, 'src', 'index.html'),
favicon: path.resolve(__dirname, 'assets', 'favicon.ico')
})
]
};
// Create either a production or development build depending on the `production` env setting
module.exports = settings;