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$/,
|
||||
use: [
|
||||
'ts-loader',
|
||||
argv.mode === 'production'
|
||||
? {
|
||||
loader: 'string-replace-loader',
|
||||
options: {
|
||||
search: /(['">])\s+([<'"])/gs,
|
||||
replace: '$1$2',
|
||||
},
|
||||
}
|
||||
: null,
|
||||
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,
|
||||
search: /(?<!\/\/[^\n]*)(\\n|\s)+/gs,
|
||||
replace: ' ',
|
||||
},
|
||||
}
|
||||
: null,
|
||||
'ts-loader',
|
||||
].filter(Boolean),
|
||||
},
|
||||
],
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue