Skip to content

Commit a223b77

Browse files
gkalpakpetebacondarwin
authored andcommitted
fix(index-async): properly inline text containing $$
When using `'...'.replace(regex, replacement)`, any instances of `$$` inside `replacement` will be converted to `$` (see [mdn](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace#Specifying_a_string_as_a_parameter). Thus, for example `$$minErr` and `$$moduleName` are converted to `$minErr` and `$moduleName`. This commit fixes it, by first using `'...'.split(regex).join(replacement)` instead. Fixes angular#283 Closes angular#286
1 parent 50353b9 commit a223b77

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,6 @@
3232
"preprotractor": "npm run update-webdriver",
3333
"protractor": "protractor e2e-tests/protractor.conf.js",
3434

35-
"update-index-async": "node -e \"var fs=require('fs'),indexFile='app/index-async.html',loaderFile='app/bower_components/angular-loader/angular-loader.min.js',loaderText=fs.readFileSync(loaderFile,'utf-8').replace(/sourceMappingURL=angular-loader.min.js.map/,'sourceMappingURL=bower_components/angular-loader/angular-loader.min.js.map'),indexText=fs.readFileSync(indexFile,'utf-8').replace(/\\/\\/@@NG_LOADER_START@@[\\s\\S]*\\/\\/@@NG_LOADER_END@@/,'//@@NG_LOADER_START@@\\n'+loaderText+' //@@NG_LOADER_END@@');fs.writeFileSync(indexFile,indexText);\""
35+
"update-index-async": "node -e \"var fs=require('fs'),indexFile='app/index-async.html',loaderFile='app/bower_components/angular-loader/angular-loader.min.js',loaderText=fs.readFileSync(loaderFile,'utf-8').split(/sourceMappingURL=angular-loader.min.js.map/).join('sourceMappingURL=bower_components/angular-loader/angular-loader.min.js.map'),indexText=fs.readFileSync(indexFile,'utf-8').split(/\\/\\/@@NG_LOADER_START@@[\\s\\S]*\\/\\/@@NG_LOADER_END@@/).join('//@@NG_LOADER_START@@\\n'+loaderText+' //@@NG_LOADER_END@@');fs.writeFileSync(indexFile,indexText);\""
3636
}
3737
}

0 commit comments

Comments
 (0)