diff --git a/CHANGELOG.md b/CHANGELOG.md index c320a3a059..ddbba43592 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,13 @@ Changelog _Note: Gaps between patch versions are faulty, broken or test releases._ +## v3.??.?? (2022-08-??) + +#### :rocket: New Feature + +* Added new property `debugMode` to `build` object `config/default` +* Added ability to disable code optimizations for debug mode `build/webpack/optimization` + ## v3.??.? (2022-??-??) #### :house: Internal diff --git a/build/webpack/CHANGELOG.md b/build/webpack/CHANGELOG.md index 4c59aeba50..da3e40f650 100644 --- a/build/webpack/CHANGELOG.md +++ b/build/webpack/CHANGELOG.md @@ -9,6 +9,12 @@ Changelog > - :house: [Internal] > - :nail_care: [Polish] +## v3.??.?? (2022-08-??) + +#### :rocket: New Feature + +* Added ability to disable code optimizations for debug mode `build/webpack/optimization` + ## v3.24.0 (2022-08-12) #### :rocket: New Feature diff --git a/build/webpack/optimization.js b/build/webpack/optimization.js index b114a60d0e..143abc294a 100644 --- a/build/webpack/optimization.js +++ b/build/webpack/optimization.js @@ -107,5 +107,12 @@ module.exports = function optimization({buildId, plugins}) { /* eslint-enable camelcase */ ]; + if (config.build.debugMode) { + opts.minimize = false; + opts.chunkIds = 'named'; + opts.moduleIds = 'named'; + opts.mangleExports = false; + } + return opts; }; diff --git a/config/CHANGELOG.md b/config/CHANGELOG.md index 024b8e1947..8ad679be70 100644 --- a/config/CHANGELOG.md +++ b/config/CHANGELOG.md @@ -9,6 +9,12 @@ Changelog > - :house: [Internal] > - :nail_care: [Polish] +## v3.??.?? (2022-08-??) + +#### :rocket: New Feature + +* Added new property `debugMode` to `build` object + ## v3.20.0 (2022-04-25) #### :boom: Breaking Change diff --git a/config/default.js b/config/default.js index 8af6100553..64d31b00cb 100644 --- a/config/default.js +++ b/config/default.js @@ -304,6 +304,19 @@ module.exports = config.createConfig({dirs: [__dirname, 'client']}, { suit: o('suit', { env: true, default: 'demo' + }), + + /** + * If true, all code optimizations will be disabled which is suitable for application debugging + * + * @cli debug-mode + * @env DEBUG_MODE + * + * @returns {boolean} + */ + debugMode: o('debug-mode', { + env: true, + type: 'boolean' }) },