ale*_*lex 2 laravel gulp gulp-concat
在使用? 的情况下,是否可以将所有添加的内容包装js
在$(document).ready(function(){
第一行和});
最后一行中gulp-concat
?
您可以为此使用gulp-concat-util
它确实连接了所有文件,并可以选择将标题行和页脚行添加到连接的文本中
var concat = require('gulp-concat-util');
gulp.task('concat:dist', function() {
gulp.src('scripts/{,*/}*.js')
.pipe(concat(pkg.name + '.js', {process: function(src) { return (src.trim() + '\n').replace(/(^|\n)[ \t]*('use strict'|"use strict");?\s*/g, '$1'); }}))
.pipe(concat.header('(function(window, document, undefined) {\n\'use strict\';\n'))
.pipe(concat.footer('\n})(window, document);\n'))
.pipe(gulp.dest('dist'));
});
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
586 次 |
最近记录: |