From c8fd50c76f47e077d30ee3ac222bcd211ede0b22 Mon Sep 17 00:00:00 2001 From: Slava Kim Date: Tue, 26 Aug 2014 17:30:04 -0700 Subject: [PATCH] Replace colons with underscores in build output's filenames and urls --- tools/bundler.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tools/bundler.js b/tools/bundler.js index 858b05a068..87eaf1a7f7 100644 --- a/tools/bundler.js +++ b/tools/bundler.js @@ -344,6 +344,9 @@ _.extend(File.prototype, { if (url.charAt(0) !== '/') url = '/' + url; + // XXX replacing colons with underscores as colon is hard to escape later + // on different targets and generally is not a good separator for web. + url = url.replace(/:/g, '_'); self.url = url; }, @@ -354,6 +357,11 @@ _.extend(File.prototype, { self.targetPath = relPath; else self.targetPath = path.join('app', relPath); + + // XXX same as in setUrlFromRelPath, we replace colons with a different + // separator to avoid difficulties further. E.g.: on Windows it is not a + // valid char in filename, Cordova also rejects it, etc. + self.targetPath = self.targetPath.replace(/:/g, '_'); }, // Set a source map for this File. sourceMap is given as a string.