Skip to content

Code minification#734

Open
ExactlyNoSense wants to merge 5 commits intomasterfrom
exactlynosense/minify-config
Open

Code minification#734
ExactlyNoSense wants to merge 5 commits intomasterfrom
exactlynosense/minify-config

Conversation

@ExactlyNoSense
Copy link
Contributor

Added ability to explicitly define whether you need a code minification or not.

Now it could be done via cli argument optimize-minify or via env variable OPTIMIZE_MINIFY.

By default code is minified in production mode and not minified in other case.

@ExactlyNoSense ExactlyNoSense force-pushed the exactlynosense/minify-config branch from 0a0eb9d to 54d216f Compare August 16, 2022 13:33
*
* @returns {boolean}
*/
debugMode: o('debug-mode', {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Мне кажется просто debug лучше назвать, т.к. оно и так понятно, что это режим.

Плюс у нас есть в настройках есть

/** @override */
	runtime() {
		return {
			...super.runtime(),
			engine: this.engine(),

			debug: false,

И тут бы прораститить тот дебаг в этот.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

debug из рантайма попадает в конфиг моника, а также в глобальные константы. Не получится ли так, что кто-то с этим дебагом (из runtime) подвяжется на изменение отображения или подключение других зависимостей. А я всего-лишь хочу, чтобы всё, что было в проде, просто собралось чуть подубонее для дебага.

Можно сделать как-то так: добавить параметр/переменную окружения debug-build, которая будет делать то, что сейчас debug-mode, а ещё сделать параметр/переменную окружения debug, которая будет включать debug-build а так же проставлять debug в runtime.

Т.е. можно будет либо включать весь дебаг везде сразу, либо более точно изменять только сборку проекта. Что скажешь?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ну в принципе да, можно сделать в конфиге

build.debug -- параметр debug-build

и debug в корне, который включает build.debug и runtime.debug


#### :rocket: New Feature

* Added new property `debugMode` to `build` object `config/default`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* Added new property `debugMode` to `build` object `config/default`
* Added a new property `build.debugMode` `config/default`

#### :rocket: New Feature

* Added new property `debugMode` to `build` object `config/default`
* Added ability to disable code optimizations for debug mode `build/webpack/optimization`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* Added ability to disable code optimizations for debug mode `build/webpack/optimization`
* Debugging mode now disables code minimization `build/webpack/optimization`


#### :rocket: New Feature

* Added ability to disable code optimizations for debug mode `build/webpack/optimization`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* Added ability to disable code optimizations for debug mode `build/webpack/optimization`
* Debugging mode now disables code minimization

/* eslint-enable camelcase */
];

if (config.build.debugMode) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

А оно только JS не сжимает, или CSS тоже?

По хорошему надо бы оставить все.


#### :rocket: New Feature

* Added new property `debugMode` to `build` object
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* Added new property `debugMode` to `build` object
* Added a new property `build.debugMode`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants