Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

strip-whitespace-plugin

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

strip-whitespace-plugin

Strip whitespace from strings in javascript assets

  • 1.0.3
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

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

Keywords

FAQs

Package last updated on 06 Jan 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc