This package has been deprecated

Author message:

Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

strip-whitespace-plugin

1.0.3 • Public • Published

strip-whitespace-plugin

node Travis AppVeyor Known Vulnerabilities David Greenkeeper badge Coveralls Codacy grade

Strip-Whitespace-Plugin is a plugin for webpack that will remove extraneous spaces from strings. It's perfect for working with rendering templates (ex. mustache, handlebars) or es6 javascript templates. It works with anything where you might create very long strings.

This plugin and the Strip-Whitespace-Loader do the same thing. The loader can be applied to specific modules/files/assets. This plugin will strip whitespace on all assets.

Before strip-whitespace:
function() {
  if (condition) {
    const longString = '  String   with    some    extra   spaces  ';
  }
}
After strip-whitespace:
function() {
  if (condition) {
    const longString = ' String with some extra spaces ';
  }
}
Webpack usage

Put this plugin before your minification plugins (ex. uglify-js)

var StripWhitespace = require('strip-whitespace-plugin');
 
module.exports = {
  ...
  plugins: [
    new StripWhitespace(),
    ...
    // put your minification plugins here.
  ]
  ...
};
 

Dependents (0)

Package Sidebar

Install

npm i strip-whitespace-plugin

Weekly Downloads

11

Version

1.0.3

License

MIT

Last publish

Collaborators

  • markis