Ensure prod builds don't use inline source maps

The bundle grew by a factor of 4, so let's only do that while
we're developing.
This commit is contained in:
Søren L. Hansen
2022-11-26 15:21:59 -08:00
committed by Soren L. Hansen
parent 41f09daf42
commit e0ee2822cd
5 changed files with 547 additions and 159 deletions

View File

@@ -2,6 +2,14 @@ const path = require('path');
const TerserPlugin = require("terser-webpack-plugin");
const LicenseWebpackPlugin = require('license-webpack-plugin').LicenseWebpackPlugin;
var devtool;
if (process.env.DEV === '1') {
devtool = 'inline-source-map';
} else {
devtool = 'source-map';
}
module.exports = {
entry: "./src/main.ts",
entry: {
@@ -10,7 +18,7 @@ module.exports = {
output: {
path: path.resolve(__dirname, '../bindata/static/js/'),
},
devtool: "inline-source-map",
devtool: devtool,
resolve: {
extensions: [".ts", ".tsx", ".js"],
},