Skip to content

Commit

Permalink
Move uglifyjs to npm script.
Browse files Browse the repository at this point in the history
  • Loading branch information
bardiharborow committed Dec 23, 2016
1 parent b0508a9 commit effb2fb
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 67 deletions.
28 changes: 8 additions & 20 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,24 +121,6 @@ module.exports = function (grunt) {
}
},

uglify: {
options: {
compress: {
warnings: false
},
mangle: true,
preserveComments: /^!|@preserve|@license|@cc_on/i
},
core: {
src: '<%= concat.bootstrap.dest %>',
dest: 'dist/js/<%= pkg.name %>.min.js'
},
docsJs: {
src: configBridge.paths.docsJs,
dest: 'docs/assets/js/docs.min.js'
}
},

qunit: {
options: {
inject: 'js/tests/unit/phantom.js'
Expand Down Expand Up @@ -250,6 +232,12 @@ module.exports = function (grunt) {
},
'scss-lint-docs': {
command: 'npm run scss-lint-docs'
},
uglify: {
command: 'npm run uglify'
},
'uglify-docs': {
command: 'npm run uglify-docs'
}
},

Expand Down Expand Up @@ -335,7 +323,7 @@ module.exports = function (grunt) {
grunt.registerTask('test', testSubtasks);

// JS distribution task.
grunt.registerTask('dist-js', ['babel:dev', 'concat', 'babel:dist', 'stamp', 'uglify:core']);
grunt.registerTask('dist-js', ['babel:dev', 'concat', 'babel:dist', 'stamp', 'exec:uglify']);

grunt.registerTask('test-scss', ['exec:scss-lint']);

Expand All @@ -358,7 +346,7 @@ module.exports = function (grunt) {
// Docs task.
grunt.registerTask('docs-css', ['exec:clean-css-docs', 'exec:postcss-docs']);
grunt.registerTask('lint-docs-css', ['exec:scss-lint-docs']);
grunt.registerTask('docs-js', ['uglify:docsJs']);
grunt.registerTask('docs-js', ['exec:uglify-docs']);
grunt.registerTask('docs', ['lint-docs-css', 'docs-css', 'docs-js', 'clean:docs', 'copy:docs']);
grunt.registerTask('docs-github', ['jekyll:github']);

Expand Down
46 changes: 1 addition & 45 deletions grunt/npm-shrinkwrap.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
"postcss-docs": "postcss --config grunt/postcss.js --no-map --replace docs/assets/css/docs.min.css && postcss --config grunt/postcss.js --no-map --replace docs/examples/**/*.css",
"scss-lint": "bundle exec scss-lint --config scss/.scss-lint.yml --exclude scss/_normalize.scss scss/*.scss",
"scss-lint-docs": "bundle exec scss-lint --config scss/.scss-lint.yml --exclude docs/assets/scss/docs.scss docs/assets/scss/*.scss",
"uglify": "uglifyjs --compress warnings=false --mangle --comments '/^!/' --output dist/js/bootstrap.min.js dist/js/bootstrap.js",
"uglify-docs": "uglifyjs --compress warnings=false --mangle --comments '/^!/' --output docs/assets/js/docs.min.js docs/assets/js/vendor/*.js docs/assets/js/src/application.js",
"update-shrinkwrap": "npm shrinkwrap --dev && shx mv ./npm-shrinkwrap.json ./grunt/npm-shrinkwrap.json",
"test": "npm run eslint && npm run jscs && grunt test"
},
Expand Down Expand Up @@ -62,7 +64,6 @@
"grunt-contrib-copy": "^1.0.0",
"grunt-contrib-qunit": "^1.2.0",
"grunt-contrib-sass": "^1.0.0",
"grunt-contrib-uglify": "^2.0.0",
"grunt-contrib-watch": "^1.0.0",
"grunt-exec": "^1.0.1",
"grunt-html": "^8.0.2",
Expand All @@ -78,7 +79,8 @@
"postcss-flexbugs-fixes": "^2.0.0",
"shelljs": "^0.7.4",
"shx": "^0.1.4",
"time-grunt": "^1.4.0"
"time-grunt": "^1.4.0",
"uglify-js": "^2.7.5"
},
"engines": {
"node": ">=4"
Expand Down

0 comments on commit effb2fb

Please sign in to comment.