Skip to content

Commit

Permalink
🐞 fix: 初步处理了打包失败的bug;
Browse files Browse the repository at this point in the history
  • Loading branch information
ruan-cat committed Jun 24, 2024
1 parent 15721b5 commit 0484b91
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 13 deletions.
5 changes: 4 additions & 1 deletion packages/vuepress-preset-config/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,13 @@
"exports": {
".": {
"require": "./dist/vuepress-preset-config.umd.js",
"module": "./dist/vuepress-preset-config.mjs",
"module": "./dist/vuepress-preset-config.js",
"types": ""
}
},
"files": [
"dist"
],
"devDependencies": {
"@types/node": "^20.12.11"
},
Expand Down
27 changes: 15 additions & 12 deletions packages/vuepress-preset-config/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,21 +25,24 @@ export default defineConfig({
// 参考:https://cn.vitejs.dev/config/build-options.html#build-rollupoptions
rollupOptions: {
// 确保外部化处理那些你不想打包进库的依赖
external: [
/\@vuepress\/bundler-vite.*/,
// /vuepress.*/,
/vuepress-theme-hope.*/,
/fsevents.*/,
/node.*/,
],
external: ["@vuepress/bundler-vite", "vuepress", "vuepress-theme-hope"],
// external: [
// /\@vuepress\/bundler-vite.*/,
// //
// /vuepress.*/,
// /vuepress-theme-hope.*/,
// // /vuepress*/,
// // /vuepress-theme-hope*/,
// /fsevents.*/,
// /node.*/,
// ],

output: {
// 在 UMD 构建模式下为这些外部化的依赖提供一个全局变量。即使不设置,构建工具也会为我们自动生成。个人倾向于不设置
/*
globals: {
lodash: 'lodash'
}
*/
globals: {
vuepress: "vuepress",
"vuepress-theme-hope": "vuepress-theme-hope",
},
},
},
},
Expand Down

0 comments on commit 0484b91

Please sign in to comment.