Skip to content

Commit

Permalink
minor change
Browse files Browse the repository at this point in the history
  • Loading branch information
powerful23 committed Jul 18, 2018
1 parent 7feb17e commit fee4596
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 17 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
"@types/jest": "^20.0.7",
"@types/node": "^8.9.5",
"codecov": "^1.0.1",
"compression-webpack-plugin": "^1.1.3",
"jest": "^22.4.3",
"json-loader": "^0.5.7",
"lerna": "^2.4.0",
Expand Down
5 changes: 2 additions & 3 deletions packages/amazon-cognito-identity-js/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,8 @@
"clean": "rimraf lib es",
"build:commonjs": "cross-env BABEL_ENV=commonjs babel src --out-dir lib",
"build:es": "cross-env BABEL_ENV=es babel src --out-dir es",
"build:umd": "cross-env BABEL_ENV=commonjs NODE_ENV=development webpack -p dist/amazon-cognito-identity.js",
"build:umd:min": "cross-env BABEL_ENV=commonjs NODE_ENV=production webpack -p dist/amazon-cognito-identity.min.js",
"build": "npm run clean && npm run build:commonjs && npm run build:es && npm run build:umd && npm run build:umd:min",
"build:umd": "webpack",
"build": "npm run clean && npm run build:commonjs && npm run build:es && npm run build:umd",
"doc": "jsdoc src -d docs",
"lint": "eslint src",
"test": "eslint src",
Expand Down
31 changes: 17 additions & 14 deletions packages/amazon-cognito-identity-js/webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
// version 3.11.0
const UglifyJsPlugin = require('uglifyjs-webpack-plugin');
const CompressionPlugin = require("compression-webpack-plugin")

/* eslint-disable */
var webpack = require('webpack');
Expand All @@ -21,14 +23,27 @@ var banner = '/*!\n' +
' */\n\n';

var config = {
entry: './src/index.js',
entry: {
'amazon-cognito-identity': './src/index.js',
'amazon-cognito-identity.min': './src/index.js'
},
output: {
filename: '[name].js',
path: __dirname + '/dist',
libraryTarget: 'umd',
library: 'AmazonCognitoIdentity'
},
plugins: [
new webpack.optimize.OccurrenceOrderPlugin(),
new webpack.BannerPlugin({ banner, raw: true })
new webpack.BannerPlugin({ banner, raw: true }),
new UglifyJsPlugin({
minimize: true,
sourceMap: true,
include: /\.min\.js$/,
}),
new CompressionPlugin({
include: /\.min\.js$/,
})
],
module: {
rules: [
Expand All @@ -46,16 +61,4 @@ var config = {
}
};

if (process.env.NODE_ENV === 'production') {
config.devtool = 'source-map';
config.plugins.push(
new webpack.optimize.UglifyJsPlugin({
sourceMap: true,
compress: {
warnings: false
}
})
);
}

module.exports = config;

0 comments on commit fee4596

Please sign in to comment.