Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/fireantjs/fireant-uglify
UglifyJS plugin for Fireant
https://github.com/fireantjs/fireant-uglify
fireant npm npmjs uglify uglifyjs
Last synced: about 2 months ago
JSON representation
UglifyJS plugin for Fireant
- Host: GitHub
- URL: https://github.com/fireantjs/fireant-uglify
- Owner: fireantjs
- License: mit
- Created: 2017-02-14T15:47:46.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2017-02-19T10:40:03.000Z (almost 8 years ago)
- Last Synced: 2024-10-13T08:05:11.879Z (3 months ago)
- Topics: fireant, npm, npmjs, uglify, uglifyjs
- Language: JavaScript
- Size: 8.79 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
#fireant-uglify
UglifyJS plugin for [Fireant](https://github.com/fireantjs/fireant)
## Installation
```shell
npm install -D fireant-uglify
```
## Sample fireantfile.js using one file```javascript
var fireant = require("fireant");
var uglify = require("fireant-uglify");fireant.task("watch", function() {
fireant.watch("js/*.js", function(file) {
uglify("js/common.js").save("html/js/common.min.js");
});
});
```
## Sample fireantfile.js using one file, with options```javascript
var fireant = require("fireant");
var uglify = require("fireant-uglify");
var global = require('global');global.options = {
uglify: {
preserveComments: false,
compress: true,
mangle: true
}
};fireant.task("watch", function() {
fireant.watch("js/*.js", function(file) {
uglify("js/common.js").save("html/js/common.min.js");
});
});
```## Sample fireantfile.js using multiple files
```javascript
var fireant = require("fireant");
var uglify = require("fireant-uglify");fireant.task("watch", function() {
fireant.watch("js/*.js", function(file) {
uglify(["js/common.js", "js/app.js"]).save("html/js/common.min.js");
});
});
```## Sample fireantfile.js using string
```javascript
var fireant = require("fireant");
var uglify = require("fireant-uglify");fireant.task("watch", function() {
fireant.watch("js/*.js", function(file) {
var js = "var foo = 'bar';";
(js).uglify().save("html/js/common.min.js");
});
});
```