webpack: switch devtool to eval-source-map, use in development mode only

This commit is contained in:
Matthias Schiffer 2018-11-07 00:19:10 +01:00
parent 35c49f8666
commit c87d044687
Signed by: neocturne
GPG key ID: 16EF3F64CB201D9C

View file

@ -1,8 +1,8 @@
const path = require('path'); const path = require('path');
module.exports = { module.exports = (env, argv) => {
let config = {
entry: './src/index.ts', entry: './src/index.ts',
devtool: 'inline-source-map',
devServer: { devServer: {
contentBase: './dist' contentBase: './dist'
}, },
@ -28,4 +28,11 @@ module.exports = {
filename: 'bundle.js', filename: 'bundle.js',
path: path.resolve(__dirname, 'dist') path: path.resolve(__dirname, 'dist')
}, },
};
if (argv.mode === 'development') {
config.devtool = 'eval-source-map';
}
return config;
}; };