Remove even more whitespace
This commit is contained in:
parent
d46fb44ff7
commit
2e41fb3199
1 changed files with 11 additions and 2 deletions
|
|
@ -105,17 +105,26 @@ module.exports = (env, argv) => ({
|
||||||
{
|
{
|
||||||
test: /\.ts$/,
|
test: /\.ts$/,
|
||||||
use: [
|
use: [
|
||||||
'ts-loader',
|
argv.mode === 'production'
|
||||||
|
? {
|
||||||
|
loader: 'string-replace-loader',
|
||||||
|
options: {
|
||||||
|
search: /(['">])\s+([<'"])/gs,
|
||||||
|
replace: '$1$2',
|
||||||
|
},
|
||||||
|
}
|
||||||
|
: null,
|
||||||
argv.mode === 'production'
|
argv.mode === 'production'
|
||||||
? {
|
? {
|
||||||
// for removing whitespace (mainly from template strings) which are not part of comments
|
// for removing whitespace (mainly from template strings) which are not part of comments
|
||||||
loader: 'string-replace-loader',
|
loader: 'string-replace-loader',
|
||||||
options: {
|
options: {
|
||||||
search: /(?<!\/\/[^\n]*)\s+/gs,
|
search: /(?<!\/\/[^\n]*)(\\n|\s)+/gs,
|
||||||
replace: ' ',
|
replace: ' ',
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
: null,
|
: null,
|
||||||
|
'ts-loader',
|
||||||
].filter(Boolean),
|
].filter(Boolean),
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue