Skip to content

Commit

Permalink
[TASK] add possibility to minify JS, add uglifyJs, fix #306
Browse files Browse the repository at this point in the history
  • Loading branch information
dmh committed Nov 3, 2017
1 parent 93d1f26 commit d683a53
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 0 deletions.
1 change: 1 addition & 0 deletions felayout_t3kit/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,4 @@ npm install
- Run `grunt check` to check CSS (.stylelintrc) and JS (JS standard) files according code conventions.
- Run `grunt compileCss` or `grunt cc` to compile all Front-End service files plus **CSS** styling for **t3kit** needs and copy it to `theme_t3kit/Resources/Public/css` folder.
- Run `grunt compileLess` or `grunt cl` to compile all Front-End service files plus **LESS** styling for **t3kit** needs, copy it to it to `theme_t3kit/Resources/Public/less` folder.
- Run `grunt production` or `grunt prod` to compile all Front-End service files for production. `compileCss` + `compileLess` + `uglifyJs`
12 changes: 12 additions & 0 deletions felayout_t3kit/grunt/aliases.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,18 @@ check:
#CSS
- 'stylelint:less'

# ==================================
# compileLess + compileCss + uglifyJs
# ==================================
production:
- 'compileLess'
- 'compileCss'
- 'uglify'

# alias to production
prod:
- 'production'

# ==================================
# Task helpers ====================
# ==================================
Expand Down
18 changes: 18 additions & 0 deletions felayout_t3kit/grunt/uglify.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
module.exports = {
lessFolder: {
files: [{
expand: true,
cwd: '<%= lessFolder %>',
src: '**/*.js',
dest: '<%= lessFolder %>'
}]
},
cssFolder: {
files: [{
expand: true,
cwd: '<%= cssFolder %>',
src: '**/*.js',
dest: '<%= cssFolder %>'
}]
}
}
1 change: 1 addition & 0 deletions felayout_t3kit/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
"grunt-contrib-watch": "1.0.0",
"grunt-import": "1.0.3",
"grunt-newer": "1.3.0",
"grunt-contrib-uglify": "3.1.0",
"grunt-standard": "3.1.0",
"grunt-stylelint": "0.9.0",
"less-plugin-autoprefix": "1.5.1",
Expand Down

0 comments on commit d683a53

Please sign in to comment.