forked from VNG-Realisatie/api-test-platform-code
-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
42 lines (35 loc) · 968 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
39
40
41
42
var paths = require('./build/paths');
var argv = require('yargs').argv;
var isProduction = process.env.NODE_ENV === 'production';
if (argv.production) {
isProduction = true;
}
/**
* Webpack configuration
* Run using "webpack" or "gulp js"
*/
module.exports = {
// Path to the js entry point (source).
entry: {
main: __dirname + '/' + paths.jsEntry,
},
// Path to the (transpiled) js
output: {
path: __dirname + '/' + paths.jsDir, // directory
filename: '[name].js' // file
},
// Use --production to optimize output.
mode: isProduction ? 'production' : 'development',
// Add babel (see .babelrc for settings)
module: {
rules: [
{
exclude: /node_modules/,
loader: 'babel-loader',
test: /.js?$/
}
]
},
// Use --sourcemap to generate sourcemap.
devtool: argv.sourcemap ? 'sourcemap' : false,
}