https://github.com/jamen/pull-minify
Minify JS and CSS files inside a pull-stream
https://github.com/jamen/pull-minify
Last synced: about 1 year ago
JSON representation
Minify JS and CSS files inside a pull-stream
- Host: GitHub
- URL: https://github.com/jamen/pull-minify
- Owner: jamen
- License: mit
- Created: 2017-05-13T06:19:03.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2017-05-13T06:46:57.000Z (about 9 years ago)
- Last Synced: 2024-10-20T01:56:53.237Z (over 1 year ago)
- Language: JavaScript
- Homepage:
- Size: 9.77 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: LICENSE
Awesome Lists containing this project
README
# pull-minify
> Minify JS and CSS files inside a pull-stream
```js
pull(
read(__dirname + '/src/**/*.{js,css}'),
minify({
js: { mangle: true, toplevel: true },
css: { restructure: true }
}),
write(__dirname + '/out')
)
```
## Install
```sh
npm install --save pull-minify
```
```sh
yarn add pull-minify
```
## Usage
### `minify(options)`
Minifies CSS and JS files based on extension
Options are `options.js` and `options.css` which go to `minify.js` and `minify.css`.
```js
pull(
read(__dirname + '/src/**/*.{js,css}'),
minify({
js: { ...options.js },
css: { ...options.css }
}),
write(__dirname + '/out')
)
```
You can opt out by passing `js: false`, `css: false`, etc.
### `minify.js(options)`
### `minify.css(options)`
Convenience functions. They are identical to:
- [`pull-minify-js`](https://github.com/jamen/pull-minify-js)
- [`pull-minify-css`](https://github.com/jamen/pull-minify-css)
---
Maintained by [Jamen Marz](https://git.io/jamen) (See on [Twitter](https://twitter.com/jamenmarz) and [GitHub](https://github.com/jamen) for questions & updates)