我试着和django一起使用。我所有的注入脚本都正常工作,在注入之后进行手动路径更新,但是现在我想连接我的注入脚本。这是我的html
<!-- build:css({compile/serve,src}) styles/vendor.css -->
<!-- bower:css -->
<link rel="stylesheet" href="{{ STATIC_URL }}dash/bower_components/angular-material/angular-material.css" />
<link rel="stylesheet" href="{{ STATIC_URL }}dash/bower_components/nvd3/src/nv.d3.css" />
<!-- endbower -->
<!-- endbuild -->
<!-- build:css({compile/serve,src}) styles/app.css -->
<!-- inject:css -->
<link rel="stylesheet" href="{{ STATIC_URL }}dash/compile/serve/styles/main.css">
<!-- endinject -->
<!-- endbuild -->和
<!-- build:js(src) scripts/vendor.js -->
<!-- bower:js -->
<script src="{{ STATIC_URL }}dash/bower_components/angular/angular.js"></script>
<script src="{{ STATIC_URL }}dash/bower_components/angular-animate/angular-animate.js"></script>
<script src="{{ STATIC_URL }}dash/bower_components/angular-cookies/angular-cookies.js"></script>
<script src="{{ STATIC_URL }}dash/bower_components/angular-touch/angular-touch.js"></script>
<script src="{{ STATIC_URL }}dash/bower_components/angular-sanitize/angular-sanitize.js"></script>
<script src="{{ STATIC_URL }}dash/bower_components/angular-resource/angular-resource.js"></script>
<script src="{{ STATIC_URL }}dash/bower_components/angular-route/angular-route.js"></script>
<script src="{{ STATIC_URL }}dash/bower_components/angular-aria/angular-aria.js"></script>
<script src="{{ STATIC_URL }}dash/bower_components/angular-material/angular-material.js"></script>
<script src="{{ STATIC_URL }}dash/bower_components/angular-messages/angular-messages.js"></script>
<script src="{{ STATIC_URL }}dash/bower_components/pace/pace.js"></script>
<script src="{{ STATIC_URL }}dash/bower_components/d3/d3.js"></script>
<script src="{{ STATIC_URL }}dash/bower_components/nvd3/nv.d3.js"></script>
<script src="{{ STATIC_URL }}dash/bower_components/angularjs-nvd3-directives/dist/angularjs-nvd3-directives.js"></script>
<!-- endbower -->
<!-- endbuild -->
<!-- build:js({compile/serve,src}) scripts/app.js -->
<!-- inject:js -->
<script src="{{ STATIC_URL }}dash/src/js/dashboard/services/api/campaigns.js"></script>
<script src="{{ STATIC_URL }}dash/src/js/dashboard/controllers/navigation/sidebar.js"></script>
<script src="{{ STATIC_URL }}dash/src/js/dashboard/controllers/navigation/header.js"></script>
<script src="{{ STATIC_URL }}dash/src/js/dashboard/controllers/forms/company-settings.js"></script>
<script src="{{ STATIC_URL }}dash/src/js/dashboard/controllers/forms/campaign-create.js"></script>
<script src="{{ STATIC_URL }}dash/src/js/dashboard/directives/file-reader.js"></script>
<script src="{{ STATIC_URL }}dash/src/js/app.js"></script>
<!-- endinject -->
<!-- inject:partials -->
<!-- angular templates will be automatically converted in js and inserted here -->
<!-- endinject -->
<!-- endbuild -->我只想从路径中删除{{ STATIC_URL }}dash,因为这是我的gulpfile.js所在的根目录(不同于index.html目录),将脚本处理到相应的文件中,然后用编译css和js来更新index.html。但前期的{{ STATIC_URL }}dash
发布于 2015-04-16 21:21:11
我们最近也遇到了类似的问题,gulp-replace在这里做得很好。你会像这样用它
gulp.src('path/to/my/index.html')
.pipe(replace(/{{ STATIC_URL }}dash/g,'withsomethingelse')
.pipe(/* start the useref stuff now */)我不知道在这条路上.可能您必须将静态URL替换为与index.html相关的内容,而不是gulpfile。
https://stackoverflow.com/questions/29663037
复制相似问题