I am currently facing an issue with strip-loader in my Typescript project that is built with Webpack.
The ts-loader statement in my project is as follows:
{ test: /\.ts$/, loader: 'babel-loader?presets[]=es2015!ts-loader' }
Everything seems to be working fine with this configuration. However, I have a lot of console logging using Angular's $log service, and I want to remove lines like:
this.$log.log ("Some message here");
To achieve this, I made an update to my Webpack file:
{ test: /\.ts$/, loader: 'babel-loader?presets[]=es2015!strip-loader?strip[]=this.log!ts-loader' }
My thought process was to generate ES6 with TS, strip out lines starting with this.$log
, and then transpile it to ES5 with Babel. However, despite trying different patterns in strip-loader like strip[]=this
, it doesn't seem to have any effect on the code.
Can someone please point out what I might be doing wrong?
Thank you, Jeff