Skip to content

Commit

Permalink
Uglify using ascii_only
Browse files Browse the repository at this point in the history
  • Loading branch information
compulim committed Apr 16, 2019
1 parent a160c8b commit d4e5dfe
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 60 deletions.
16 changes: 16 additions & 0 deletions packages/bundle/webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
const { resolve } = require('path');
const TerserPlugin = require('terser-webpack-plugin');
const Visualizer = require('webpack-visualizer-plugin');

module.exports = {
Expand All @@ -18,6 +19,21 @@ module.exports = {
use: ['style-loader', 'css-loader']
}]
},
optimization: {
minimizer: [
// Webpack use terser for minification
// https://webpack.js.org/configuration/mode#usage
// https://webpack.js.org/plugins/terser-webpack-plugin/#terseroptions
new TerserPlugin({
terserOptions: {
// https://github.com/terser-js/terser#minify-options
output: {
ascii_only: true
}
}
})
]
},
output: {
filename: '[name].js',
libraryTarget: 'umd',
Expand Down
3 changes: 0 additions & 3 deletions scripts/deploy_cdn
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,17 @@ echo Will publish to CDN at $PACKAGE_NAME/$PACKAGE_VERSION/*

# Upload to based on version from package.json
~/blobxfer upload --local-path $TRAVIS_BUILD_DIR/packages/bundle/dist --remote-path $PACKAGE_NAME/$PACKAGE_VERSION --storage-account $CDN_BLOB_ACCOUNT --storage-account-key $CDN_BLOB_KEY
node ./scripts/setJavaScriptContentType.js $PACKAGE_NAME $PACKAGE_VERSION/

# If TRAVIS_TAG is present, it means this is going PRODUCTION
if [ -n "$TRAVIS_TAG" ]
then
# Upload to /latest/
~/blobxfer upload --local-path $TRAVIS_BUILD_DIR/packages/bundle/dist --remote-path $PACKAGE_NAME/latest --storage-account $CDN_BLOB_ACCOUNT --storage-account-key $CDN_BLOB_KEY
node ./scripts/setJavaScriptContentType.js $PACKAGE_NAME latest/
fi

# If on "master" branch, deploy to "master" tag too
if [ "$TRAVIS_BRANCH" = "master" ]
then
# Upload to /master/
~/blobxfer upload --local-path $TRAVIS_BUILD_DIR/packages/bundle/dist --remote-path $PACKAGE_NAME/master --storage-account $CDN_BLOB_ACCOUNT --storage-account-key $CDN_BLOB_KEY
node ./scripts/setJavaScriptContentType.js $PACKAGE_NAME master/
fi
57 changes: 0 additions & 57 deletions scripts/setJavaScriptContentType.js

This file was deleted.

0 comments on commit d4e5dfe

Please sign in to comment.