Skip to content

Commit 5404142

Browse files
authored
feat(bundle-size): minify js, too (#67)
1 parent 68c063a commit 5404142

File tree

5 files changed

+653
-627
lines changed

5 files changed

+653
-627
lines changed

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
"@types/react-dom": "^16.8.5",
3434
"@types/react-router-dom": "^4.3.4",
3535
"@types/storybook__react": "^4.0.2",
36-
"@types/victory": "^31.0.14",
36+
"@types/victory": "^33.0.0",
3737
"@types/webpack": "^4.32.1",
3838
"css-loader": "^3.2.0",
3939
"enzyme": "^3.7.0",
@@ -56,6 +56,7 @@
5656
"rimraf": "^3.0.0",
5757
"style-loader": "^1.0.0",
5858
"svg-url-loader": "^3.0.0",
59+
"terser-webpack-plugin": "^2.1.0",
5960
"ts-jest": "^24.0.0",
6061
"ts-loader": "^6.0.2",
6162
"tsconfig-paths-webpack-plugin": "^3.2.0",

src/app/AppLayout/AppLayout.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ const AppLayout: React.FunctionComponent<IAppLayout> = ({children}) => {
4848
<Nav id="nav-primary-simple">
4949
<NavList id="nav-list-simple" variant={NavVariants.simple}>
5050
{routes.map((route, idx) => {
51-
return (
51+
return route.label && (
5252
<NavItem key={`${route.label}-${idx}`} id={`${route.label}-${idx}`}>
5353
<NavLink exact={true} to={route.path} activeClassName="pf-m-current">{route.label}</NavLink>
5454
</NavItem>

tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
"paths": {
2222
"@app/*": ["src/app/*"],
2323
"@assets/*": ["node_modules/@patternfly/react-core/dist/styles/assets/*"]
24-
},
24+
}
2525
},
2626
"include": [
2727
"**/*.ts",

webpack.prod.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,14 @@ const merge = require('webpack-merge');
33
const common = require('./webpack.common.js');
44
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
55
const OptimizeCSSAssetsPlugin = require('optimize-css-assets-webpack-plugin');
6+
const TerserJSPlugin = require('terser-webpack-plugin');
67

78
module.exports = merge(common, {
89
mode: 'production',
910
devtool: 'source-map',
1011
optimization: {
1112
minimizer: [
13+
new TerserJSPlugin({}),
1214
new OptimizeCSSAssetsPlugin({})
1315
],
1416
},

0 commit comments

Comments
 (0)