Created
February 19, 2018 23:15
-
-
Save johnkingzy/a4e55d0d18ee91582cd0d785015d2b36 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//js scripts replace regex | |
var jsSearch = /{{ — angular scripts begin — }}[\s\S]*{{ — angular scripts end — }}/; | |
var jsReplaceStr = | |
“{{ — angular scripts begin — }}” + | |
“\n\t\t” + | |
scripts.join(“\n\t\t”) + | |
“\n\t\t{{ — angular scripts end — }}”; | |
//css styles replace regex | |
var cssSearch = /{{ — angular styles begin — }}[\s\S]*{{ — angular styles end — }}/; | |
var cssReplaceStr = | |
“{{ — angular styles begin — }}” + | |
“\n\t\t” + | |
styles.join(“\n\t\t”) + | |
“\n\t\t{{ — angular styles end — }}”; | |
//replace app stylesheet links and js script tags with new ones | |
var content = fs.readFileSync( | |
“./../server/resources/views/welcome.blade.php”, | |
“utf8” | |
); | |
content = content | |
.replace(jsSearch, jsReplaceStr) | |
.replace(cssSearch, cssReplaceStr); | |
fs.writeFileSync( | |
“./../server/resources/views/welcome.blade.php”, | |
content, | |
“utf8” | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment