Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/markis/strip-whitespace-plugin
Strip whitespace from strings within javascript files
https://github.com/markis/strip-whitespace-plugin
asset-pipeline minification performance webpack webpack-plugin webpack2 whitespace
Last synced: 4 days ago
JSON representation
Strip whitespace from strings within javascript files
- Host: GitHub
- URL: https://github.com/markis/strip-whitespace-plugin
- Owner: markis
- License: mit
- Archived: true
- Created: 2017-03-15T04:07:02.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2020-04-08T01:35:54.000Z (over 4 years ago)
- Last Synced: 2024-09-24T20:04:13.202Z (7 days ago)
- Topics: asset-pipeline, minification, performance, webpack, webpack-plugin, webpack2, whitespace
- Language: TypeScript
- Homepage: https://npm.im/strip-whitespace-plugin
- Size: 81.1 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# strip-whitespace-plugin
[![node](https://img.shields.io/node/v/strip-whitespace-plugin.svg)](https://www.npmjs.com/package/strip-whitespace-plugin)
[![Travis](https://img.shields.io/travis/markis/strip-whitespace-plugin.svg)](https://travis-ci.org/markis/strip-whitespace-plugin)
[![AppVeyor](https://img.shields.io/appveyor/ci/markis/strip-whitespace-plugin.svg)](https://ci.appveyor.com/project/markis/strip-whitespace-plugin)
[![Known Vulnerabilities](https://snyk.io/test/github/markis/strip-whitespace-plugin/badge.svg)](https://snyk.io/test/github/markis/strip-whitespace-plugin)
[![David](https://img.shields.io/david/markis/strip-whitespace-plugin.svg)](https://david-dm.org/markis/strip-whitespace-plugin)
[![Greenkeeper badge](https://badges.greenkeeper.io/markis/strip-whitespace-plugin.svg)](https://greenkeeper.io/)
[![Coveralls](https://img.shields.io/coveralls/markis/strip-whitespace-plugin.svg)](https://coveralls.io/github/markis/strip-whitespace-plugin)
[![Codacy grade](https://img.shields.io/codacy/grade/56982b9998354357beea778664fb2cfe.svg)](https://www.codacy.com/app/markis/strip-whitespace-plugin)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](https://npm.im/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:
``` javascript
function() {
if (condition) {
const longString = ' String with some extra spaces ';
}
}
```##### After strip-whitespace:
``` javascript
function() {
if (condition) {
const longString = ' String with some extra spaces ';
}
}
```##### Webpack usage
Put this plugin before your minification plugins (ex. uglify-js)
``` javascript
var StripWhitespace = require('strip-whitespace-plugin');module.exports = {
...
plugins: [
new StripWhitespace(),
...
// put your minification plugins here.
]
...
};```