Fix sourcemap

This commit is contained in:
Andras Schmelczer 2022-09-26 19:13:03 +02:00
parent f41bab1156
commit cceb1a7a1f
No known key found for this signature in database
GPG key ID: 0EA1BC97D0AB076E

View file

@ -12,8 +12,10 @@ module.exports = (env, argv) => ({
entry: {
index: './src/index.ts',
},
watchOptions: {
ignored: '**/node_modules',
},
optimization: {
minimize: true,
minimizer: [
new TerserPlugin({
terserOptions: {
@ -104,15 +106,17 @@ module.exports = (env, argv) => ({
test: /\.ts$/,
use: [
'ts-loader',
{
// for removing whitespace (mainly from template strings) which are not part of comments
loader: 'string-replace-loader',
options: {
search: /(?<!\/\/[^\n]*)\s+/gs,
replace: ' ',
},
},
],
argv.mode === 'production'
? {
// for removing whitespace (mainly from template strings) which are not part of comments
loader: 'string-replace-loader',
options: {
search: /(?<!\/\/[^\n]*)\s+/gs,
replace: ' ',
},
}
: null,
].filter(Boolean),
},
],
},