问题
During the build process of an angular app, I would like to update the <base href="/app-dev/">
tag to <base href="/app/">
inside index.html
Is there a way to update this tag with usemin
(for now, I use it to update the links to the js and css)? If not, what grunt task should I use to do that?
回答1:
I used grunt-processhtml too like so
in your say index.html file
<!-- build:[href]:build /path/you/want/ -->
<base href="/~myusername/myapp/public/" />
<!-- /build -->
in your Gruntfile.js add a task config like so
processhtml: {
options: {
//
},
build: {
files: {
'dist/index.html':['public/index.html']
}
}
}
and install the npm package of course!
npm install grunt-processhtml --save-dev
来源:https://stackoverflow.com/questions/21162992/using-grunt-to-update-base-href