mirror of
https://github.com/youzan/vant.git
synced 2025-10-16 16:04:04 +00:00
chore(popperjs): use Rslib to build (#13252)
This commit is contained in:
@@ -1,40 +0,0 @@
|
||||
const { build, context } = require('esbuild');
|
||||
|
||||
async function bundle(format) {
|
||||
const ext = format === 'esm' ? '.mjs' : '.js';
|
||||
const outfile = `dist/index.${format}${ext}`;
|
||||
const finish = () => console.log('Build finished:', outfile);
|
||||
|
||||
const options = {
|
||||
format,
|
||||
bundle: true,
|
||||
target: ['chrome53'],
|
||||
outfile,
|
||||
// preserve Chinese character
|
||||
charset: 'utf8',
|
||||
external: ['vue', 'vant'],
|
||||
entryPoints: ['./src/index.ts'],
|
||||
};
|
||||
|
||||
if (process.argv.includes('-w')) {
|
||||
const loggerPlugin = {
|
||||
name: 'loggerPlugin',
|
||||
setup(build) {
|
||||
build.onEnd(finish);
|
||||
},
|
||||
};
|
||||
|
||||
const ctx = await context({
|
||||
...options,
|
||||
plugins: [loggerPlugin],
|
||||
});
|
||||
|
||||
await ctx.watch();
|
||||
} else {
|
||||
await build(options);
|
||||
finish();
|
||||
}
|
||||
}
|
||||
|
||||
bundle('esm');
|
||||
bundle('cjs');
|
||||
@@ -37,7 +37,6 @@
|
||||
"license": "MIT",
|
||||
"devDependencies": {
|
||||
"@rslib/core": "^0.1.3",
|
||||
"esbuild": "^0.24.0",
|
||||
"typescript": "^5.7.2",
|
||||
"vue": "^3.5.13"
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user