Skip to content

Instantly share code, notes, and snippets.

@njleonzhang
Last active May 11, 2018 05:55
Show Gist options
  • Save njleonzhang/2bf540f65f8bcfa05c408ead3f09b60b to your computer and use it in GitHub Desktop.
Save njleonzhang/2bf540f65f8bcfa05c408ead3f09b60b to your computer and use it in GitHub Desktop.
concat all file in one
/**
将本文件拷贝到你的目录下。
安装依赖
安装nodejs环境
npm install gulp-cli -g
cnpm i gulp-concat gulp
修改gulp.src里的后缀名来指定你需要拼接文件的后缀名和要排除的文件。
run命令 `gulp`, boom ~~~~ done.
*/
const gulp = require('gulp')
const concat = require('gulp-concat')
gulp.task('default', () => {
return gulp.src(['./**/*.{js, scss, css, html, vue, json}', '!./dist/**']) // '!./node_modules/**'
.pipe(concat('all.txt'))
.pipe(gulp.dest('./concat/'))
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment