Skip to content
This repository has been archived by the owner on Jan 4, 2023. It is now read-only.

Commit

Permalink
fix: Add Terser to Build Process (#5)
Browse files Browse the repository at this point in the history
* Fix #3

* Fix #3 with a general solution

* Clean Up

* Add Terser to Optimize Prod Build

* Add Terser options for Safari
  • Loading branch information
s0kil authored and notrab committed May 29, 2019
1 parent 9bebcd6 commit d64eab9
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
"mini-css-extract-plugin": "^0.6.0",
"optimize-css-assets-webpack-plugin": "^5.0.1",
"prop-types": "15.7.2",
"terser-webpack-plugin": "^1.3.0",
"webpack": "4.30.0",
"webpack-cli": "3.3.1",
"webpack-dev-server": "3.3.1",
Expand Down
14 changes: 13 additions & 1 deletion webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ const { join, resolve } = require('path')
const MiniCssExtractPlugin = require('mini-css-extract-plugin')
const OptimizeCSSAssetsPlugin = require('optimize-css-assets-webpack-plugin')
const JavaScriptObfuscator = require('webpack-obfuscator')
const TerserPlugin = require('terser-webpack-plugin')

const { NODE_ENV } = process.env

Expand Down Expand Up @@ -44,7 +45,18 @@ module.exports = {
libraryTarget: 'window'
},
optimization: {
minimizer: [new OptimizeCSSAssetsPlugin({})],
minimizer: [
new OptimizeCSSAssetsPlugin({}),
new TerserPlugin({
cache: true,
parallel: true,
terserOptions: {
safari10: true,
ie8: true,
ecma: 5
}
})
],
splitChunks: {
cacheGroups: {
styles: {
Expand Down

0 comments on commit d64eab9

Please sign in to comment.