YahooArchive / strip-loader

Webpack loader to strip arbitrary functions out of your production code.
Other
282 stars 14 forks source link

config for webpack2? #21

Closed francoisromain closed 7 years ago

francoisromain commented 7 years ago

Hello what's the config to work with webpack 2?

I tried this (without success):

{ test: /\.js$/, use: [{ loader: 'babel-loader' }, { loader: 'strip-loader', options: { 'strip[]': 'console.log' } }] }

camsjams commented 7 years ago

Did you ever get this working? Also curious myself

camsjams commented 7 years ago

Solved this (for console at least) in Webpack 2 by just using the UglifyJsPlugin

new webpack.optimize.UglifyJsPlugin({
    compress: {
        warnings: false,
        drop_console: true
    },
    comments: false
})
francoisromain commented 7 years ago

@camsjams yep, same here.