对于 django,我正在尝试插入相对路径..
我的旧 grunt 文件的wiredep 部分看起来像这样
wiredep: {
dashboard: {
src: '<%= backOffice.dashboard %>/base.html',
exclude: ['/selectize/', '/sifter/', '/microplugin/'],
ignorePath: '../../static/',
fileTypes: {
html: {
replace: {
js: '<script src="{{ STATIC_URL }}{{filePath}}"></script>',
css: '<link rel="stylesheet" href="{{ STATIC_URL }}{{filePath}}" />'
}
}
}
}
}
我正在尝试对我的wiredep.js 执行相同的gulp 任务,这就是它的样子
'use strict';
var gulp = require('gulp');
// inject bower components
gulp.task('wiredep', function() {
var wiredep = require('wiredep').stream;
gulp.src('src/{app,components}/*.scss')
.pipe(wiredep({
directory: 'src/bower_components'
}))
.pipe(gulp.dest('src'));
gulp.src('../../templates/backoffice/__base.html')
.pipe(wiredep({
fileTypes: {
html: {
replace: {
js: '<script src="{{ STATIC_URL }}{{filePath}}"></script>',
css: '<link rel="stylesheet" href="{{ STATIC_URL }}{{filePath}}" />'
}
}
}
}));
但这不起作用,有人可以帮忙吗?