grunt-bower-requirejs icon indicating copy to clipboard operation
grunt-bower-requirejs copied to clipboard

Option to avoid overwriting customized paths

Open andyinabox opened this issue 10 years ago • 1 comments
trafficstars

It would be nice if there was a simple toggle option that avoids overwriting existing paths in the requirejs config file.

For instance: some packages are setup so that the "main" script is not what I want (say it's a minified version of the script instead of source, or it's an index.js file that only works with node.js), but grunt-bower-requirejs automatically sets that path. Even if I correct the path, every time I update my bower dependencies it gets overwritten with the wrong path.

I recognize that I could explicitly fix this with the exclude option, but a more desired behavior would be for the task to assume that if there is already a path for a certain module in the config, that it should leave it alone.

Maybe if there were a simple overwrite option that defaulted to true, but when set to false would leave existing paths?

andyinabox avatar Jan 26 '15 14:01 andyinabox

With this configuration you would run into unexpected conflicts when paths of installed bower components change after updating a package. In this case it should be the desired behavior for this task to overwrite the path. I would prefer the exclude option for manually changed module paths but maybe combining the overwrite option with a check for file existence could be a way to go.

bezoerb avatar Jan 26 '15 22:01 bezoerb