Skip to content

Commit

Permalink
feat: 设置vite构建配置,解决无法在顶级作用域使用await
Browse files Browse the repository at this point in the history
  • Loading branch information
宋兴国 committed May 24, 2024
1 parent 41d9a51 commit 537d14e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/.vuepress/plugin/vuepress-plugin-demo/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@ export const DemoPlugin = (options) => {
console.log("--onInitialized");
},
extendsBundlerOptions(bundlerOptions, app) {
console.log("bundlerOptions");
// 修改 @vuepress/bundler-vite 的配置项
if (app.options.bundler.name === '@vuepress/bundler-vite') {
bundlerOptions.viteOptions.build.target ??= "es2019"
}
console.log("bundlerOptions", bundlerOptions);
},
};
};
Expand Down

0 comments on commit 537d14e

Please sign in to comment.