Skip to content
This repository was archived by the owner on Feb 26, 2024. It is now read-only.

Commit 50353b9

Browse files
gkalpakpetebacondarwin
authored andcommitted
fix(index-async): fix inlining of angular-loader into index-async.html
Previously, `angular-loader` was never inlined into `index-async.html`, because running `sed` with a multiline RegExp fails to match anything, since `sed` matches per line. Using the `fs` module directly, solves the issues. (Now, we no longer depend on `shelljs`.) Closes #309
1 parent a0f0875 commit 50353b9

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

package.json

+2-3
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,7 @@
1414
"karma-firefox-launcher": "^0.1.7",
1515
"karma-jasmine": "^0.3.8",
1616
"karma-junit-reporter": "^0.4.1",
17-
"protractor": "^3.2.2",
18-
"shelljs": "^0.6.0"
17+
"protractor": "^3.2.2"
1918
},
2019
"scripts": {
2120
"postinstall": "bower install",
@@ -33,6 +32,6 @@
3332
"preprotractor": "npm run update-webdriver",
3433
"protractor": "protractor e2e-tests/protractor.conf.js",
3534

36-
"update-index-async": "node -e \"require('shelljs/global'); sed('-i', /\\/\\/@@NG_LOADER_START@@[\\s\\S]*\\/\\/@@NG_LOADER_END@@/, '//@@NG_LOADER_START@@\\n' + sed(/sourceMappingURL=angular-loader.min.js.map/,'sourceMappingURL=bower_components/angular-loader/angular-loader.min.js.map','app/bower_components/angular-loader/angular-loader.min.js') + '\\n//@@NG_LOADER_END@@', 'app/index-async.html');\""
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);\""
3736
}
3837
}

0 commit comments

Comments
 (0)