-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
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
gulp 构建工具 #12
Comments
gulp 的 路径 问题 https://github.com/wearefractal/vinyl vinyl 有 base cwd relative gulp.src("src/**/*.js")
pipe(gulp.dest("dist")) 那么文件就是 自己new gutil.File 的时候,提供 base,path就行了 |
gobble 构建工具 转换ES6 JS代码 https://github.com/gobblejs/gobble-es6-transpiler gobble( 'src/js' ).transform( 'es6-transpiler' ) |
gulp deps
结果
gulp start
结果
gulp.start Async
结果
|
ts import gulp from 'gulp'
import execa from 'execa'
interface TaskMeta {
name?: string
desc?: string
flags?: Object
run: () => Promise<void> | void
}
function taskFn(data: TaskMeta) {
const run = data.run
Object.assign(run, {
description: data.desc,
flags: data.flags,
displayName: data.name,
})
return run
}
const task = (meta: TaskMeta) => gulp.task(taskFn(meta))
task({
name: 'pkg',
desc: '生成 pkg',
async run() {
execa.commandSync('pkg -t node12-mac .', {
cwd: __dirname,
stdio: 'inherit',
})
},
}) |
gulp v4 transitive deprecated depsWARN deprecated source-map-resolve@0.5.3: See https://github.com/lydell/source-map-resolve#deprecated gulpjs/gulp#2641 我们不解决问题, 解决提出问题的人~ |
gulp through2.obj(transform_function_here)
想要接受到一串文件,实现concat类似操作
用 through https://github.com/dominictarr/through/blob/master/index.js
例子 https://github.com/wearefractal/gulp-concat/blob/master/index.js
The text was updated successfully, but these errors were encountered: