artembatura / zero-scriptsjs

A modular approach to develop modern JavaScript projects with minimal configuration.
MIT License
6 stars 1 forks source link

Config sync algorithm should check relevance of current external config and update only plugin related part #663

Closed artembatura closed 3 years ago

artembatura commented 3 years ago

For example we don't use TS at the beginning and @zero-scripts/plugin-webpack-babel will generate babel.config.js with support for JS files. But then we started using TypeScript and our current babel.config.js cannot handle TS files.

As a current behaviour after adding TypeScript and creating tsconfig.json developer should delete generated babel.config.js and then this file will be generated again with added plugins/presets. It's slightly weird because config sync feature was added to allow developer to make additional changes with ease and without learning Zero Scripts plugins custom options.

As a solution we should remember all user additions or deletions in configuration and then regenerate this configuration with actual support for TypeScript and with this changes.

Other solution can be to put all conditional configuration parts in config itself, but it will increase configuration size and decrease readability,

artembatura commented 3 years ago

After some thinking I understand that config sync is not really needed.

artembatura commented 3 years ago

Closing in favour of #666