feat(cli): bump vite 4.2, esbuild 0.17 (#11682)
This commit is contained in:
@@ -37,7 +37,7 @@
|
||||
"author": "chenjiahan",
|
||||
"license": "MIT",
|
||||
"devDependencies": {
|
||||
"esbuild": "^0.16.10",
|
||||
"esbuild": "^0.17.12",
|
||||
"release-it": "^15.4.1",
|
||||
"rimraf": "^4.0.4",
|
||||
"typescript": "^5.0.2"
|
||||
|
||||
@@ -60,7 +60,7 @@
|
||||
"commander": "^10.0.0",
|
||||
"consola": "^2.15.3",
|
||||
"conventional-changelog": "^3.1.25",
|
||||
"esbuild": "^0.16.10",
|
||||
"esbuild": "^0.17.12",
|
||||
"eslint": "^8.31.0",
|
||||
"execa": "^6.1.0",
|
||||
"fast-glob": "^3.2.11",
|
||||
@@ -86,7 +86,7 @@
|
||||
"terser": "^5.16.1",
|
||||
"transliteration": "^2.3.5",
|
||||
"typescript": "^5.0.2",
|
||||
"vite": "^4.0.3",
|
||||
"vite": "^4.2.0",
|
||||
"vite-plugin-md": "^0.11.9",
|
||||
"vue-router": "^4.1.5"
|
||||
},
|
||||
|
||||
@@ -39,7 +39,7 @@
|
||||
"@vue/runtime-core": "^3.2.47",
|
||||
"vant": "workspace:*",
|
||||
"vue": "^3.2.47",
|
||||
"esbuild": "^0.16.10",
|
||||
"esbuild": "^0.17.12",
|
||||
"release-it": "^15.1.1",
|
||||
"rimraf": "^4.0.4",
|
||||
"typescript": "^5.0.2"
|
||||
|
||||
@@ -38,7 +38,7 @@
|
||||
"license": "MIT",
|
||||
"devDependencies": {
|
||||
"@popperjs/core": "^2.11.6",
|
||||
"esbuild": "^0.16.10",
|
||||
"esbuild": "^0.17.12",
|
||||
"release-it": "^15.4.1",
|
||||
"rimraf": "^4.0.4",
|
||||
"typescript": "^5.0.2"
|
||||
|
||||
@@ -1,13 +1,11 @@
|
||||
const { build } = require('esbuild');
|
||||
const { build, context } = require('esbuild');
|
||||
|
||||
function bundleBundle(format) {
|
||||
async function bundle(format) {
|
||||
const ext = format === 'esm' ? '.mjs' : '.js';
|
||||
const outfile = `dist/index.${format}${ext}`;
|
||||
const finish = () => console.log('Build finished:', outfile);
|
||||
const onRebuild = (error) => (error ? console.log(error) : finish());
|
||||
|
||||
build({
|
||||
watch: process.argv.includes('-w') && { onRebuild },
|
||||
const options = {
|
||||
format,
|
||||
bundle: true,
|
||||
target: ['chrome53'],
|
||||
@@ -16,8 +14,27 @@ function bundleBundle(format) {
|
||||
charset: 'utf8',
|
||||
external: ['vue', 'vant'],
|
||||
entryPoints: ['./src/index.ts'],
|
||||
}).then(finish);
|
||||
};
|
||||
|
||||
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();
|
||||
}
|
||||
}
|
||||
|
||||
bundleBundle('esm');
|
||||
bundleBundle('cjs');
|
||||
bundle('esm');
|
||||
bundle('cjs');
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
"author": "chenjiahan",
|
||||
"license": "MIT",
|
||||
"devDependencies": {
|
||||
"esbuild": "^0.16.10",
|
||||
"esbuild": "^0.17.12",
|
||||
"release-it": "^15.4.1",
|
||||
"rimraf": "^4.0.4",
|
||||
"typescript": "^5.0.2",
|
||||
|
||||
Reference in New Issue
Block a user