Skip to content

Commit

Permalink
Update docs.
Browse files Browse the repository at this point in the history
  • Loading branch information
XhmikosR committed Feb 28, 2017
1 parent d85adc7 commit 463d4d3
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 28 deletions.
41 changes: 36 additions & 5 deletions README.md
Expand Up @@ -458,16 +458,47 @@ grunt.initConfig({
uglify: {
my_target: {
files: [{
expand: true,
cwd: 'src/js',
src: '**/*.js',
dest: 'dest/js'
expand: true,
cwd: 'src/js',
src: '**/*.js',
dest: 'dest/js'
}]
}
}
});
```

#### Compiling all files separately on the each their path

This configuration will compress and mangle all js files separately in each folder.

Also exclude jQuery for mangling and ignore all `*.min.js` files.

```js
// Project configuration.
uglify: {
dev: {
options: {
mangle: {
except: ['jQuery']
}
},
files: [{
expand: true,
src: ['dist/assets/js/*.js', '!dist/assets/js/*.min.js'],
dest: 'dist/assets',
cwd: '.',
rename: function (dst, src) {
// To keep the source js files and make new files as `*.min.js`:
// return dst + '/' + src.replace('.js', '.min.js');
// Or to override to src:
return src;
}
}]
}
},
```

#### Turn on object property name mangling

This configuration will turn on object property name mangling, but not mangle built-in browser object properties.
Expand Down Expand Up @@ -558,4 +589,4 @@ grunt.initConfig({

Task submitted by ["Cowboy" Ben Alman](http://benalman.com)

*This file was generated on Wed Feb 08 2017 11:06:25.*
*This file was generated on Tue Feb 28 2017 15:58:04.*
46 changes: 23 additions & 23 deletions docs/uglify-examples.md
Expand Up @@ -228,10 +228,10 @@ grunt.initConfig({
uglify: {
my_target: {
files: [{
expand: true,
cwd: 'src/js',
src: '**/*.js',
dest: 'dest/js'
expand: true,
cwd: 'src/js',
src: '**/*.js',
dest: 'dest/js'
}]
}
}
Expand All @@ -247,25 +247,25 @@ Also exclude jQuery for mangling and ignore all `*.min.js` files.
```js
// Project configuration.
uglify: {
dev: {
options: {
mangle: {
except: ['jQuery']
}
},
files: [{
expand: true,
src: ['dist/assets/js/*.js', '!dist/assets/js/*.min.js'],
dest: 'dist/assets',
cwd: '.',
rename: function (dst, src) {
// To keep the source js files and make new files as `*.min.js`:
// return dst + '/' + src.replace('.js', '.min.js');
// Or to override to src:
return src;
}
}]
}
dev: {
options: {
mangle: {
except: ['jQuery']
}
},
files: [{
expand: true,
src: ['dist/assets/js/*.js', '!dist/assets/js/*.min.js'],
dest: 'dist/assets',
cwd: '.',
rename: function (dst, src) {
// To keep the source js files and make new files as `*.min.js`:
// return dst + '/' + src.replace('.js', '.min.js');
// Or to override to src:
return src;
}
}]
}
},
```

Expand Down

0 comments on commit 463d4d3

Please sign in to comment.