I have a script a generic script. It runs on one website, now we start to put it on other websites but it requires customization. Most elements of the script stays the same between versions.
Right now I have branches with different versions but it isn't scalable.
I can change the script so the moving parts are enclosed as interface and then provide implementations for each website as a separate file / class.
I would like to configure the build script (right now it's webpack) so I can run:
npm run build --impl ExampleComImpl
I'm not stuck with webpack and can migrate. Main reason for using webpack is it's ability to pack all resources as one file.