Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,19 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [2.0.1] - unreleased

### Changed

- Pixi: added TerserPlugin options to webpack to drop `console.log` and `console.info` in production builds
- Pixi: added TerserPlugin options to webpack to maintain function names in debug builds

- Phaser: added TerserPlugin options to webpack to drop `console.log` and `console.info` in production builds
- Phaser: added TerserPlugin options to webpack to maintain function names in debug builds

- CreateJS: added TerserPlugin options to webpack to drop `console.log` and `console.info` in production builds
- CreateJS: added TerserPlugin options to webpack to maintain function names in debug builds

## [2.0.0] - 2024-05-09

### Changed
Expand Down
6 changes: 3 additions & 3 deletions package-lock.json

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

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "springroll-seed",
"version": "2.0.0",
"version": "2.0.1",
"description": "",
"main": "index.js",
"scripts": {
Expand All @@ -24,7 +24,7 @@
"source-map-loader": "^1.0.0",
"springroll": "^2.4.4",
"style-loader": "^3.3.1",
"terser-webpack-plugin": "^5.3.6",
"terser-webpack-plugin": "^5.3.10",
"webpack": "^5.75.0",
"webpack-cli": "^4.10.0",
"webpack-dev-server": "^4.11.1"
Expand Down
22 changes: 17 additions & 5 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,12 @@ const ESLintPlugin = require('eslint-webpack-plugin');
const TerserPlugin = require('terser-webpack-plugin');

const deploy = path.join(__dirname, 'deploy');
const isProduction = process.env.NODE_ENV == "production";

// keep the env param to be explicit, eslint disable should be removed when template is in use
// eslint-disable-next-line no-unused-vars
module.exports = (env) => {
const isProduction = !!env.production;

const plugins = [
new CleanPlugin.CleanWebpackPlugin(),
new HtmlWebpackPlugin(HtmlConfig),
Expand Down Expand Up @@ -47,10 +48,21 @@ module.exports = (env) => {
},

optimization: {
minimizer: [new TerserPlugin({
extractComments: true
})]
},
minimize: true,
minimizer: [
new TerserPlugin({

terserOptions: {
mangle: {
keep_fnames: isProduction ? false : true,
},
compress: {
drop_console: isProduction ? ['log', 'info']: false,
},
},
}),
],
},

plugins,

Expand Down