Skip to content

Commit

Permalink
Reduce bundle.js size #1268 (#2667)
Browse files Browse the repository at this point in the history
* add TerserPlugin to webpack config to minify js files #1268

* enable keep_classnames and keep_fnames as they changing that breaks the app #1268

* add changelog entry #1268
  • Loading branch information
IhsenBouallegue committed Feb 21, 2022
1 parent 4e9d7fd commit 1745198
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 54 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/)

## [1.90.0] - 2022-02-15

### Fixed 🐞

- Improve loading times by reducing the size of JavaScript files [#2667](https://github.com/MaibornWolff/codecharta/pull/2667)

### Added 🚀

- Parse and import GameObjects file structure into cc.json on upload [#2646](https://github.com/MaibornWolff/codecharta/pull/2646)
Expand Down
12 changes: 12 additions & 0 deletions visualization/conf/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ const { CleanWebpackPlugin } = require("clean-webpack-plugin")
const { DefinePlugin } = require("webpack")
const NodePolyfillPlugin = require("node-polyfill-webpack-plugin")
const dist = path.resolve(__dirname, "../dist/webpack")
const TerserPlugin = require("terser-webpack-plugin")

module.exports = env => {
return {
Expand Down Expand Up @@ -41,6 +42,17 @@ module.exports = env => {
devtool: "source-map",
resolve: {
extensions: [".ts", ".tsx", ".js"]
},
optimization: {
minimize: true,
minimizer: [
new TerserPlugin({
terserOptions: {
keep_classnames: true,
keep_fnames: true
}
})
]
}
}
}
69 changes: 15 additions & 54 deletions visualization/package-lock.json

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

1 change: 1 addition & 0 deletions visualization/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,7 @@
"puppeteer": "^13.0.0",
"sass-loader": "^12.0.0",
"style-loader": "^2.0.0",
"terser-webpack-plugin": "^5.3.1",
"ts-jest": "^26.5.5",
"ts-loader": "^9.0.0",
"typescript": "^4.3.5",
Expand Down

0 comments on commit 1745198

Please sign in to comment.