We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
https://npm.proxy.ustclug.org/package/gulp-concat-replace
gulpfile.js:
var dist_path='dist'; gulp.task('concat-replace',['minify-css','concat-js'], function(){ return gulp.src(dist_path+'/*.html') .pipe(concatreplace({ prefix:'concat', base:'../', output:{ css:dist_path+'/css', js:dist_path+'/js' } })) .pipe(gulp.dest(dist_path));// html 替换后的目录 });
index.html :
<link rel="stylesheet" href="dist/css/index_concat_1.css">
资源引用地址,携带着dist目录。 和您例子中的不一致
The text was updated successfully, but these errors were encountered:
将output设置为:css/jss,html中引用地址为:css/a.css, js/b.css 然后,将文件(index_concat_2.js/index_concat_1.css)移动到dist对应目录下
concatreplace({ prefix:'concat', base:'../', output:{ css:'css', js:'js' } });
gulp.src('js/') .pipe(gulp.dest(dist_path+'/js/')); gulp.src('css/').pipe(gulp.dest(dist_path+'/css/')); del('js/'); del('css/');
通过此方式,可以正常使用
Sorry, something went wrong.
最后使用 gulp-html-replace 插件更直接。
No branches or pull requests
https://npm.proxy.ustclug.org/package/gulp-concat-replace
gulpfile.js:
var dist_path='dist';
gulp.task('concat-replace',['minify-css','concat-js'], function(){
return gulp.src(dist_path+'/*.html')
.pipe(concatreplace({
prefix:'concat',
base:'../',
output:{
css:dist_path+'/css',
js:dist_path+'/js'
}
}))
.pipe(gulp.dest(dist_path));// html 替换后的目录
});
index.html :
<link rel="stylesheet" href="dist/css/index_concat_1.css">
资源引用地址,携带着dist目录。
和您例子中的不一致
The text was updated successfully, but these errors were encountered: