Skip to content
Permalink
Browse files

abandon uglify-es, see #39. bump package version.

  • Loading branch information...
rossmartin committed Mar 27, 2018
1 parent 0f67cb0 commit eeb41a851fbf23b44439485885394d9e243fce9c
Showing with 7 additions and 6 deletions.
  1. +4 −2 README.md
  2. +1 −1 after_prepare/uglify.js
  3. +2 −2 package.json
  4. +0 −1 uglify-config.json
@@ -1,6 +1,6 @@
# cordova-uglify

Cordova hook that allows you to uglify or minify your apps JavaScript and CSS. It is using [UglifyJS2 (uglify-es for ES6+)](https://github.com/mishoo/UglifyJS2/tree/harmony) for JavaScript compression and [clean-css](https://github.com/GoalSmashers/clean-css) to minify CSS. [`uglify-es`](https://github.com/mishoo/UglifyJS2/tree/harmony) has some additional options available so refer to the docs for it if you wish to add additional compression options to the default config shown below.
Cordova hook that allows you to uglify or minify your apps JavaScript and CSS. It is using [UglifyJS2](https://github.com/mishoo/UglifyJS2) for JavaScript compression and [clean-css](https://github.com/GoalSmashers/clean-css) to minify CSS.

[![NPM](https://nodei.co/npm/cordova-uglify.png?downloads=true&stars=true)](https://nodei.co/npm/cordova-uglify/)

@@ -17,6 +17,9 @@ After install an `after_prepare` folder will be added to your `hooks` folder wit
## Usage
Once you have this hook installed it will compress your apps JavaScript and CSS when you run a `cordova prepare <platform>` or `cordova build <platform>` command. This hook does not change your assets that live in the root www folder; it will uglify the assets that get output to the platforms folder after a `prepare` or `build`. By default the hook will uglify the JavaScript and minify CSS files by recursively searching the folders provided in the `foldersToProcess` in the `uglify-config.json` (relative to your project root directory). You can disable the recursive search by setting the `recursiveFolderSearch` to `false` in the JSON config file. If you want to process files only when building/preparing for release include `--release` in your CLI command like this - `cordova prepare ios --release`. Please see the note below about usage with Ionic 2.


*___Important Note___ - If you are using ES6+ in your cordova project make sure it is transpiled to ES5 before using this hook.
## Configuration
```javascript
{
@@ -25,7 +28,6 @@ Once you have this hook installed it will compress your apps JavaScript and CSS
"foldersToProcess": [ // when recursiveFolderSearch is set to false only files in these directories will be processed
"js",
"css",
"img",
"build" // this is needed for Ionic 2 projects
],
"uglifyJsOptions": { // pass options to UglifyJS2 (you can include more than these below)
@@ -7,7 +7,7 @@ var fs = require('fs');
var path = require('path');
var dependencyPath = path.join(process.cwd(), 'node_modules');
// cordova-uglify module dependencies
var UglifyJS = require(path.join(dependencyPath, 'uglify-es'));
var UglifyJS = require(path.join(dependencyPath, 'uglify-js'));
var CleanCSS = require(path.join(dependencyPath, 'clean-css'));
var ngAnnotate = require(path.join(dependencyPath, 'ng-annotate'));

@@ -1,6 +1,6 @@
{
"name": "cordova-uglify",
"version": "0.3.1",
"version": "0.3.2",
"description": "Cordova hook that allows you to uglify or minify your apps JavaScript and CSS.",
"homepage": "https://github.com/rossmartin/cordova-uglify",
"keywords": [
@@ -14,7 +14,7 @@
"clean-css": "4.1.9",
"ng-annotate": "0.15.4",
"shelljs": "^0.7.0",
"uglify-es": "3.3.10"
"uglify-js": "3.3.16"
},
"author": "Ross Martin",
"license": "MIT",
@@ -4,7 +4,6 @@
"foldersToProcess": [
"js",
"css",
"img",
"build"
],
"uglifyJsOptions": {

0 comments on commit eeb41a8

Please sign in to comment.
You can’t perform that action at this time.