Ckeditor5: Builds should clean the `build` directory before each `npm run build` task

Created on 30 Nov 2017  路  6Comments  路  Source: ckeditor/ckeditor5

For now, running npm run build inside one of out three builds just adds webpack output files to the build directory. After merging the #624, it became dangerous, because loading old translation files with the new editor will blow up the UI labels.

bug

All 6 comments

I'll add this removal as a plugin to the webpack's config since it's the safest way, because we know exactly the output directory and this is the last step of building the editor.

Hmm. But assuming, that nobody will call the webpack from these packages, we can add rm -rf build to the build-ckeditor.sh, so it will be called during the build-ckeditor task.

I would use webpack plugin to do this and leave build-ckeditor.sh as an entry point. I think it will be a OS-safe solution.

And like you said, it'll give a developer some insights, that this part is needed for some reason.

The problem here is not critical. Nothing bad will happen if some old language files will be kept. So it's not a problem if people would forget about this somehow.

The second point is that only the lang directory is a problem, am I right? This directory is managed by the CKEditorWebpackPlugin(). If it's not loaded, then it won't be created at all. So, cleaning up this directory should be the role of this plugin. So wherever and whenever you'll use it, the cleanup will be done.

Installing a separate webpack plugin to solve accountability of another piece of code is not a good solution. It reminds me grunt times when everything was maintained in a configuration meaning that configuration was crucial to do things right. And configuration is already hard to maintain. Every change like the one proposed in ckeditor/ckeditor5-build-balloon#5 needs to be then copied to every place where we document our plugin's usage. And everyone who already had it configured would need to know that something has changed.

I have to agree with you. I'll try to do it nicely on the CKEditorWebpackPlugin's side.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

metalelf0 picture metalelf0  路  3Comments

pjasiun picture pjasiun  路  3Comments

hamenon picture hamenon  路  3Comments

devaptas picture devaptas  路  3Comments

pomek picture pomek  路  3Comments