gpt4 book ai didi

grunt-wiredep - 如何控制wiredep如何生成bower文件路径以及如何控制添加/删除哪些文件

转载 作者:行者123 更新时间:2023-12-03 13:56:17 25 4
gpt4 key购买 nike

我的应用程序的目录如下

app -> appName -> index.html (js,css)

出于某种原因,这个 appName 包装文件夹搞乱了wiredire

{ dest: '.tmp/concat/scripts/vendor.js',
src:
[ '../bower_components/es5-shim/es5-shim.js',
'../bower_components/angular/angular.js',
'../bower_components/json3/lib/json3.js',
'../bower_components/angular-resource/angular-resource.js',
'../bower_components/angular-cookies/angular-cookies.js',
'../bower_components/angular-sanitize/angular-sanitize.js',
'../bower_components/angular-animate/angular-animate.js',
'../bower_components/angular-touch/angular-touch.js',
'../bower_components/angular-route/angular-route.js' ] },

如果目录如下

应用程序-> index.html(js,css)
{ dest: '.tmp/concat/scripts/vendor.js',
src:
[ 'bower_components/es5-shim/es5-shim.js',
'bower_components/angular/angular.js',
'bower_components/json3/lib/json3.js',
'bower_components/angular-resource/angular-resource.js',
'bower_components/angular-cookies/angular-cookies.js',
'bower_components/angular-sanitize/angular-sanitize.js',
'bower_components/angular-animate/angular-animate.js',
'bower_components/angular-touch/angular-touch.js',
'bower_components/angular-route/angular-route.js' ] },

并且wiredep 确实改变了index.html 的脚本内容,我该如何控制该流程?有时它会从脚本中去除 angular-sanitize [src]

最佳答案

您应该使用 替换 有线EP选项:

wiredep(
{
fileTypes: {
html: {
replace: {
js: '<script src="/app/appName/{{filePath}}"></script>'
}
}
}
})

会产生:
<script src="/app/appName/bower_components/angular/angular.js"></script>

关于grunt-wiredep - 如何控制wiredep如何生成bower文件路径以及如何控制添加/删除哪些文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25024333/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com