1.0.3 • Published 6 years ago

strip-whitespace-plugin v1.0.3

Weekly downloads
4
License
MIT
Repository
github
Last release
6 years ago

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.
  ]
  ...
};
1.0.3

6 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago

0.0.10

7 years ago

0.0.9

7 years ago

0.0.8

7 years ago

0.0.7

7 years ago

0.0.6

7 years ago

0.0.5

7 years ago

0.0.3

7 years ago

0.0.2

7 years ago