strip-loader
Advanced tools
Comparing version 0.1.0 to 0.1.1
@@ -17,3 +17,3 @@ /** | ||
var regexPattern = new RegExp('\\n[ \\t]*(' + toStrip + ')\\([^\\);]+\\)[ \\t]*[;\\n]', 'g'); | ||
var regexPattern = new RegExp('(?:^|\\n)[ \\t]*(' + toStrip + ')\\([^\\);]+\\)[ \\t]*(?:$|[;\\n])', 'g'); | ||
@@ -20,0 +20,0 @@ var transformed = source.replace(regexPattern, '\n'); |
{ | ||
"name": "strip-loader", | ||
"version": "0.1.0", | ||
"version": "0.1.1", | ||
"description": "Webpack loader to strip arbitrary functions out of your production code.", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
@@ -75,12 +75,16 @@ # Strip Loader | ||
### Remove stripped functions from bundle | ||
### Replace unused module | ||
So far we've removed the calls to the debug function, but webpack will still include the `debug` module in the final bundle. Use the [`IgnorePlugin`](http://webpack.github.io/docs/list-of-plugins.html#ignoreplugin) | ||
So far we've removed the calls to the debug function, but your app still requires the `debug` module in the final bundle. Use the [`NormalModuleReplacementPlugin`](http://webpack.github.io/docs/list-of-plugins.html#normalmodulereplacementplugin) to replace it with an empty function: | ||
```javascript | ||
// webpack config | ||
{ | ||
plugins: [ | ||
new webpack.IgnorePlugin(/debug/) | ||
new webpack.NormalModuleReplacementPlugin(/debug/, process.cwd() + '/emptyDebug.js'), | ||
] | ||
} | ||
// emptyDebug.js | ||
module.exports = function() { return new Function(); }; | ||
``` | ||
@@ -87,0 +91,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
6724
99