-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathwebpack.config.js
38 lines (36 loc) · 923 Bytes
/
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
import webpack from 'webpack';
import HtmlWebpackPlugin from 'html-webpack-plugin';
export default function webpack_config(env, argv) {
return {
entry: './src/component-app.js',
mode: (env.production ? 'production' : 'development'),
output: {
clean: true,
filename: 'bundle.js'
},
module: {
rules: [
{
test: [/\bmessages_en\.yaml$/],
type: 'javascript/auto',
loader: '@messageformat/loader',
options: { locale: ['en'] }
}
]
},
devServer: {
static: './dist'
},
plugins: [
new HtmlWebpackPlugin({
title: 'Agricola',
scriptLoading: 'module'
}),
new webpack.DefinePlugin({
// version is injected during production build. see deploy.yml
VERSION: JSON.stringify(env.version ?? 'dev'),
PRODUCTION: env.production === true,
}),
]
};
}