mirror of
https://github.com/youzan/vant.git
synced 2025-10-17 16:44:21 +00:00
build: using esbuild instead of rollup (#10010)
This commit is contained in:
20
packages/vant-use/build.js
Normal file
20
packages/vant-use/build.js
Normal file
@@ -0,0 +1,20 @@
|
||||
const { build } = require('esbuild');
|
||||
|
||||
function bundleBundle(format) {
|
||||
const outfile = `dist/index.${format}.js`;
|
||||
const finish = () => console.log('Build finished:', outfile);
|
||||
const onRebuild = (error) => (error ? console.log(error) : finish());
|
||||
|
||||
build({
|
||||
watch: process.argv.includes('-w') && { onRebuild },
|
||||
format,
|
||||
bundle: true,
|
||||
target: ['chrome53'],
|
||||
outfile,
|
||||
external: ['vue'],
|
||||
entryPoints: ['./src/index.ts'],
|
||||
}).then(finish);
|
||||
}
|
||||
|
||||
bundleBundle('esm');
|
||||
bundleBundle('cjs');
|
Reference in New Issue
Block a user