-
Notifications
You must be signed in to change notification settings - Fork 2
/
webpack.config.js
38 lines (34 loc) · 995 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
38
const config = require('georap-config');
// compile js assets into a single bundle file
module.exports = {
// Entry: the main file that requires all others.
entry: './client/index.js',
// Output: where to store the generated files.
output: {
// Directory to which the compiled static files will be stored.
path: config.staticDir,
// Relative URL from where the bundle chunks will be read.
publicPath: config.staticUrl + '/',
// The name of the bundle and its source maps.
filename: 'app.bundle.js',
// The name of the chunks
chunkFilename: '[id]-[name].js',
},
module: {
rules: [
{
test: /\.css$/i,
use: ['style-loader', 'css-loader'],
},
{
test: /\.ejs$/,
loader: 'ejs-loader',
options: {
esModule: false, // enable CommonJS modules. Maybe set true in future.
},
},
],
},
mode: 'production', // in {development, production}
devtool: 'source-map',
};