Skip to content

Commit

Permalink
Merge pull request #125 from RobotlegsJS/migrate-to-terser-webpack-pl…
Browse files Browse the repository at this point in the history
…ugin

Migrate to terser-webpack-plugin
  • Loading branch information
tiagoschenkel authored Feb 15, 2020
2 parents a20e2a6 + db29cee commit ff30d46
Show file tree
Hide file tree
Showing 5 changed files with 255 additions and 41 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,10 @@ Types of changes:

- For compatibility with version 4 of `pixi.js`, use `@robotlegsjs/pixi` version 1.

#### Security

- Migrate to [terser-webpack-plugin](https://github.com/webpack-contrib/terser-webpack-plugin) to solve security vulnerability (see #125).

## Robotlegs-Pixi 1.0.0

### [v1.0.1](https://github.com/RobotlegsJS/RobotlegsJS-Pixi/releases/tag/1.0.1) - 2019-10-24
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@
"bluebird": "^3.7.2",
"browserify-versionify": "^1.0.6",
"chai": "^4.2.0",
"clean-webpack-plugin": "^3.0.0",
"es6-map": "^0.1.5",
"es6-symbol": "^3.1.3",
"glslify": "^7.0.0",
Expand All @@ -99,12 +100,12 @@
"rimraf": "^3.0.2",
"sinon": "^8.1.1",
"sinon-chai": "^3.4.0",
"terser-webpack-plugin": "^2.3.5",
"ts-loader": "^6.2.1",
"ts-node": "^8.6.2",
"tslint": "^6.0.0",
"tslint-config-prettier": "^1.18.0",
"typescript": "^3.7.5",
"uglifyjs-webpack-plugin": "^2.2.0",
"webpack": "^4.41.6",
"webpack-cli": "^3.3.11",
"webpack-dev-server": "^3.10.3",
Expand Down
6 changes: 3 additions & 3 deletions webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const webpack = require("webpack");
const path = require("path");
const UglifyJsPlugin = require("uglifyjs-webpack-plugin");
const TerserPlugin = require("terser-webpack-plugin");

module.exports = env => {
if (!env) env = { production: false, karma: false };
Expand Down Expand Up @@ -51,10 +51,10 @@ module.exports = env => {
concatenateModules: true,
minimize: true,
minimizer: [
new UglifyJsPlugin({
new TerserPlugin({
cache: true,
parallel: 4,
uglifyOptions: {
terserOptions: {
output: {
comments: false
}
Expand Down
3 changes: 3 additions & 0 deletions webpack.example.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ const webpack = require("webpack");
const path = require("path");
const HtmlWebpackPlugin = require("html-webpack-plugin");
const SimpleProgressPlugin = require("webpack-simple-progress-plugin");
const { CleanWebpackPlugin } = require("clean-webpack-plugin");

module.exports = options => {
return {
Expand All @@ -23,6 +24,8 @@ module.exports = options => {
},

plugins: [
new CleanWebpackPlugin(),

new HtmlWebpackPlugin({
template: path.resolve("static/index.html"),
inject: false
Expand Down
Loading

0 comments on commit ff30d46

Please sign in to comment.