geekflyer / gulp-ui5-preload

Create a Component-preload.js file for openui5 / sapui5 projects
33 stars 10 forks source link

String '$&' messed up by gulp-ui5-preload #6

Closed cschuff closed 7 years ago

cschuff commented 7 years ago

Hi,

first of all: thanks for this great tool. I'm using it a lot.

I discovered a little and quite tricky quirk. For a library-preload.json gulp-ui5-preload minifies "\\$&" to \"\\\\JSON_CONTENT\"

I tracked this down to index.js:79 var contents = template.replace('JSON_CONTENT', jsonContent);

Problem is this: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace#Specifying_a_string_as_a_parameter

Pull Request with fix will follow.

BR Chris

cschuff commented 7 years ago

https://github.com/geekflyer/gulp-ui5-preload/pull/7

cschuff commented 7 years ago

Could you please validate and publish a new version to npm.

Thanks a lot!

BR Chris