Skip to content

Commit

Permalink
feat: vite upgrade to 4.5.2 and improve esbuildHelperChecker (#12193)
Browse files Browse the repository at this point in the history
* feat: vite deps upgrade to 4.5.2

* chore: improve esbuildMinifyIIFE check log

* chore: disable `esbuildHelperChecker` with vite mode

---------

Co-authored-by: bin.liu <[email protected]>
Co-authored-by: fz6m <[email protected]>
  • Loading branch information
3 people authored Mar 14, 2024
1 parent 2e0ae4d commit 32025ee
Show file tree
Hide file tree
Showing 4 changed files with 1,149 additions and 227 deletions.
2 changes: 1 addition & 1 deletion packages/bundler-vite/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"postcss-preset-env": "7.5.0",
"rollup-plugin-visualizer": "5.9.0",
"systemjs": "^6.14.1",
"vite": "4.3.1"
"vite": "4.5.2"
},
"devDependencies": {
"@types/caniuse-lite": "1.0.5",
Expand Down
2 changes: 1 addition & 1 deletion packages/preset-umi/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
"multer": "1.4.4",
"os-locale": "^6.0.2",
"sirv": "2.0.2",
"vite": "4.3.1"
"vite": "4.5.2"
},
"publishConfig": {
"access": "public"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,15 @@ async function checkDir(opts: { dir: string }) {
.filter((v) => varMap[v].length > 1)
.map((v) => `${v} (${varMap[v].join(', ')})`);
if (conflicts.length) {
throw new Error(
`Found conflicts in esbuild helpers: ${conflicts.join(
', ',
)}, please set esbuildMinifyIIFE: true in your config file.`,
logger.fatal(
chalk.yellow(
`Found conflicts in esbuild helpers: ${conflicts.join(', ')}`,
),
);
logger.info(
`please set ${chalk.blue('esbuildMinifyIIFE: true')} in your config file`,
);
throw new Error(`Found conflicts in esbuild helpers.`);
}
logger.info(`[esbuildHelperChecker] No conflicts found.`);
}
Expand Down Expand Up @@ -72,6 +76,7 @@ export default (api: IApi) => {
});

api.onBuildComplete(async ({ err }) => {
if (api.config.vite) return;
if (process.env.OKAM) return;
if (err) return;
const jsMinifier = api.config.jsMinifier || 'esbuild';
Expand Down
Loading

0 comments on commit 32025ee

Please sign in to comment.