Django 吞下电线以替换路径
对于django,我试图插入一个相对路径 我以前的grunt文件的wiredep部分如下所示Django 吞下电线以替换路径,django,gulp,wiredep,Django,Gulp,Wiredep,对于django,我试图插入一个相对路径 我以前的grunt文件的wiredep部分如下所示 wiredep: { dashboard: { src: '<%= backOffice.dashboard %>/base.html', exclude: ['/selectize/', '/sifter/', '/microplugin/'], ignorePath: '../../static/', fileT
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:{
仪表板:{
src:“/base.html”,
排除:['/selectize/'、'/sift/'、'/microplugin/'],
ignorePath:“../../static/”,
文件类型:{
html:{
替换:{
js:“,
css:'
}
}
}
}
}
我正在尝试对我的wiredep.js for 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}}" />'
}
}
}
}));
“严格使用”;
var gulp=需要(“gulp”);
//注入鲍尔元件
gulp.task('wiredep',function(){
var wiredep=require('wiredep')。流;
gulp.src('src/{app,components}/*.scss')
.管道(线下)({
目录:“src/bower\u组件”
}))
.管道(大口目的地(“src”);
gulp.src('../../templates/backoffice/\uu base.html')
.管道(线下)({
文件类型:{
html:{
替换:{
js:“,
css:'
}
}
}
}));
但这不起作用,有人能帮忙吗?得到答案,必须包含gulp.dest才能创建文件
gulp.src('../../templates/backoffice/__base.html')
.pipe(wiredep({
ignorePath: '../../static/',
fileTypes: {
html: {
replace: {
js: '<script src="{{ STATIC_URL }}{{filePath}}"></script>',
css: '<link rel="stylesheet" href="{{ STATIC_URL }}{{filePath}}" />'
}
}
}
}))
.pipe(gulp.dest('../../templates/backoffice'));
gulp.src('../../templates/backoffice/\uu base.html')
.管道(线下)({
ignorePath:“../../static/”,
文件类型:{
html:{
替换:{
js:“,
css:'
}
}
}
}))
.pipe(gulp.dest('../../templates/backoffice');
所以您试图通过django生成js文件,而nodejs稍后将运行?