summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthias Schiffer <mschiffer@universe-factory.net>2018-11-07 00:19:10 +0100
committerMatthias Schiffer <mschiffer@universe-factory.net>2018-11-07 00:19:10 +0100
commitc87d044687bdf48b53ed24491d639760cf195a43 (patch)
tree1b7ce8d18e80e016a1c2794745132a6084983fd2
parent35c49f8666ada458e01a14b92ec47f68c6ee1582 (diff)
downloadrpgedit-c87d044687bdf48b53ed24491d639760cf195a43.tar
rpgedit-c87d044687bdf48b53ed24491d639760cf195a43.zip
webpack: switch devtool to eval-source-map, use in development mode only
-rw-r--r--webpack.config.js61
1 files changed, 34 insertions, 27 deletions
diff --git a/webpack.config.js b/webpack.config.js
index 0bb19e9..cb4dd34 100644
--- a/webpack.config.js
+++ b/webpack.config.js
@@ -1,31 +1,38 @@
const path = require('path');
-module.exports = {
- entry: './src/index.ts',
- devtool: 'inline-source-map',
- devServer: {
- contentBase: './dist'
- },
- module: {
- rules: [
- {
- test: /\.ts$/,
- use: 'ts-loader',
- exclude: /node_modules/
- },
+module.exports = (env, argv) => {
+ let config = {
+ entry: './src/index.ts',
+ devServer: {
+ contentBase: './dist'
+ },
+ module: {
+ rules: [
{
- test: /\.(vs|fs)$/,
- use: [
- 'raw-loader'
- ]
- }
- ]
- },
- resolve: {
- extensions: [ ".ts", ".js" ]
- },
- output: {
- filename: 'bundle.js',
- path: path.resolve(__dirname, 'dist')
- },
+ test: /\.ts$/,
+ use: 'ts-loader',
+ exclude: /node_modules/
+ },
+ {
+ test: /\.(vs|fs)$/,
+ use: [
+ 'raw-loader'
+ ]
+ }
+ ]
+ },
+ resolve: {
+ extensions: [ ".ts", ".js" ]
+ },
+ output: {
+ filename: 'bundle.js',
+ path: path.resolve(__dirname, 'dist')
+ },
+ };
+
+ if (argv.mode === 'development') {
+ config.devtool = 'eval-source-map';
+ }
+
+ return config;
};