在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):ym-project/gulp-esbuild开源软件地址(OpenSource Url):https://github.com/ym-project/gulp-esbuild开源编程语言(OpenSource Language):JavaScript 100.0%开源软件介绍(OpenSource Introduction):gulp-esbuildA gulp plugin for the esbuild bundler. There are two exports available:
const {createGulpEsbuild} = require('gulp-esbuild')
const gulpEsbuild = createGulpEsbuild({
incremental: true, // enables the esbuild's incremental build
piping: true, // enables piping
}) Notice: Installationnpm install gulp-esbuild or yarn add gulp-esbuild Examplesbuild example
const {
src,
dest,
} = require('gulp')
const gulpEsbuild = require('gulp-esbuild')
function build() {
return src('./index.tsx')
.pipe(gulpEsbuild({
outfile: 'bundle.js',
bundle: true,
loader: {
'.tsx': 'tsx',
},
}))
.pipe(dest('./dist'))
}
exports.build = build
...
"scripts": {
"build": "gulp build"
}
...
npm run build watch mode example
const {
src,
dest,
watch,
} = require('gulp')
const {createGulpEsbuild} = require('gulp-esbuild')
const gulpEsbuild = createGulpEsbuild({ incremental: true })
function build() {
return src('./src/index.js')
.pipe(gulpEsbuild({
outfile: 'outfile.js',
bundle: true,
}))
.pipe(dest('./dist'))
}
function watchTask() {
watch('./src/index.js', build)
}
exports.watch = watchTask
...
"scripts": {
"watch": "gulp watch"
}
...
npm run watch More examples here Plugin arguments
|
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论