This package has been deprecated

Author message:

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

strip-whitespace-loader
TypeScript icon, indicating that this package has built-in type declarations

1.0.4 • Public • Published

strip-whitespace-loader

node Travis AppVeyor Known Vulnerabilities David Greenkeeper badge Coveralls Codacy grade

Strip-Whitespace-Loader is a loader 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.

Before strip-whitespace-loader:
function() {
  if (condition) {
    const longString = '  String   with    some    extra   spaces  ';
  }
}
After strip-whitespace-loader:
function() {
  if (condition) {
    const longString = ' String with some extra spaces ';
  }
}
Webpack usage
{
  module: {
    rules:[
      {
        test: /\.js$/,
        loader: [ 'strip-whitespace-loader', 'babel-loader' ]
      },
      {
        test: /\.tsx?$/,
        loader: [ 'strip-whitespace-loader', 'ts-loader' ]
      }
    ]
  }
}

Package Sidebar

Install

npm i strip-whitespace-loader

Weekly Downloads

596

Version

1.0.4

License

MIT

Last publish

Collaborators

  • markis