From 88b2e228c287d8aab1c9975db7da949569859430 Mon Sep 17 00:00:00 2001 From: Johann-S Date: Wed, 5 Jul 2017 09:53:23 +0200 Subject: [PATCH] Use config file for UglifyJS to ensure same behavior on every environments (#22990) --- build/uglifyjs.config.json | 5 +++++ package.json | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) create mode 100644 build/uglifyjs.config.json diff --git a/build/uglifyjs.config.json b/build/uglifyjs.config.json new file mode 100644 index 0000000000..2b53a56d96 --- /dev/null +++ b/build/uglifyjs.config.json @@ -0,0 +1,5 @@ +{ + "output" : { + "comments": "/^!/" + } +} diff --git a/package.json b/package.json index fed3fd7752..88c13ceeb3 100644 --- a/package.json +++ b/package.json @@ -35,8 +35,8 @@ "js-compile": "npm-run-all --parallel js-compile-*", "js-compile-bundle": "shx cat js/src/util.js js/src/alert.js js/src/button.js js/src/carousel.js js/src/collapse.js js/src/dropdown.js js/src/modal.js js/src/scrollspy.js js/src/tab.js js/src/tooltip.js js/src/popover.js | shx sed \"s/^(import|export).*//\" | babel --filename js/src/bootstrap.js | node build/stamp.js > dist/js/bootstrap.js", "js-compile-plugins": "babel js/src/ --out-dir js/dist/ --source-maps", - "js-minify": "uglifyjs --compress warnings=false --mangle --comments '/^!/' --output dist/js/bootstrap.min.js dist/js/bootstrap.js", - "js-minify-docs": "uglifyjs --compress warnings=false --mangle --comments '/^!/' --output assets/js/docs.min.js assets/js/vendor/anchor.min.js assets/js/vendor/clipboard.min.js assets/js/vendor/holder.min.js assets/js/src/application.js", + "js-minify": "uglifyjs --config-file build/uglifyjs.config.json --output dist/js/bootstrap.min.js dist/js/bootstrap.js", + "js-minify-docs": "uglifyjs --config-file build/uglifyjs.config.json --output assets/js/docs.min.js assets/js/vendor/anchor.min.js assets/js/vendor/clipboard.min.js assets/js/vendor/holder.min.js assets/js/src/application.js", "js-test": "phantomjs ./node_modules/qunit-phantomjs-runner/runner.js js/tests/index.html 60", "js-test-cloud": "ruby -r webrick -e \"s = WEBrick::HTTPServer.new(:Port => 3000, :DocumentRoot => Dir.pwd, :Logger => WEBrick::Log.new('/dev/null'), :AccessLog => []); trap('INT') { s.shutdown }; s.start\" & grunt saucelabs-qunit", "docs": "npm-run-all docs-compile docs-lint",