我无法在我的index.html的dist文件夹中添加以下内容:
<base href="/">
头标记后我怎么能用grunt任务呢?
参考:https://docs.angularjs.org/error/ $ location / nobase
答案 0 :(得分:0)
You can use grunt-processhtml时,不要运行jQuery函数,只能在使用<base>
- block
<!-- build:template
<base href="/">
/build -->
注意在使用grunt-processhtml
处理文件之前,模板块是如何被注释掉的。如果要将href
- 值更改为除根之外的其他值,您可以选择添加模板值。
<!-- build:template
<base href="/<%= basehref %>">
/build -->
配置:
processhtml: {
build: {
options: {
data: {
basehref: ''
}
},
files: {
'dist/index.html': ['index.html']
}
}
}