Skip to content

Commit

Permalink
fix: mark vuepress-shared noExternal
Browse files Browse the repository at this point in the history
  • Loading branch information
Mister-Hope committed Sep 1, 2022
1 parent 96b52b9 commit 5450a9b
Show file tree
Hide file tree
Showing 8 changed files with 30 additions and 5 deletions.
5 changes: 5 additions & 0 deletions packages/blog2/src/node/plugin.ts
Expand Up @@ -7,6 +7,7 @@ import {
} from "@vuepress/core";
import { getDirname, path } from "@vuepress/utils";
import { watch } from "chokidar";
import { addViteSsrNoExternal } from "vuepress-shared";

import { prepareCategory } from "./category.js";
import { prepareType } from "./type.js";
Expand Down Expand Up @@ -49,6 +50,10 @@ export const blogPlugin =
),
},

extendsBundlerOptions: (config: unknown, app): void => {
addViteSsrNoExternal({ app, config }, "vuepress-shared");
},

extendsPage: (page): void => {
if (filter(page))
page.routeMeta = {
Expand Down
2 changes: 2 additions & 0 deletions packages/comment2/src/node/plugin.ts
Expand Up @@ -3,6 +3,7 @@ import { useSassPalettePlugin } from "vuepress-plugin-sass-palette";
import {
addCustomElement,
addViteSsrExternal,
addViteSsrNoExternal,
addViteOptimizeDepsExclude,
addViteOptimizeDepsInclude,
getLocales,
Expand Down Expand Up @@ -72,6 +73,7 @@ export const commentPlugin =
if (provider === "Waline") {
addViteOptimizeDepsInclude({ app, config }, "autosize");
addViteOptimizeDepsExclude({ app, config }, "@waline/client");
addViteSsrNoExternal({ app, config }, "vuepress-shared");
}

if (provider === "Twikoo") {
Expand Down
6 changes: 5 additions & 1 deletion packages/components/src/node/plugins.ts
@@ -1,5 +1,5 @@
import { useSassPalettePlugin } from "vuepress-plugin-sass-palette";
import { getLocales } from "vuepress-shared";
import { addViteSsrNoExternal, getLocales } from "vuepress-shared";

import { backToTopLocales } from "./locales.js";
import { prepareConfigFile } from "./prepare.js";
Expand Down Expand Up @@ -31,6 +31,10 @@ export const componentsPlugin =
: getIconPrefix(options.iconAssets),
},

extendsBundlerOptions: (config: unknown, app): void => {
addViteSsrNoExternal({ app, config }, "vuepress-shared");
},

clientConfigFile: (app) => prepareConfigFile(app, options),
};
};
6 changes: 5 additions & 1 deletion packages/copy-code2/src/node/plugin.ts
@@ -1,6 +1,6 @@
import { getDirname, path } from "@vuepress/utils";
import { useSassPalettePlugin } from "vuepress-plugin-sass-palette";
import { getLocales } from "vuepress-shared";
import { addViteSsrNoExternal, getLocales } from "vuepress-shared";

import { copyCodeLocales } from "./locales.js";
import { logger } from "./utils.js";
Expand Down Expand Up @@ -34,6 +34,10 @@ export const copyCodePlugin =
CODE_COPY_LOCALES: userCopyCodeLocales,
}),

extendsBundlerOptions: (config: unknown, app): void => {
addViteSsrNoExternal({ app, config }, "vuepress-shared");
},

clientConfigFile: path.resolve(__dirname, "../client/config.js"),
};
};
2 changes: 1 addition & 1 deletion packages/lightgallery/rollup.config.js
Expand Up @@ -3,10 +3,10 @@ import { rollupTypescript } from "../../scripts/rollup";
export default [
...rollupTypescript("node/index", {
external: [
"vuepress-shared",
"@vuepress/utils",
"vue",
"vuepress-plugin-sass-palette",
"vuepress-shared",
],
}),
...rollupTypescript("client/config", {
Expand Down
3 changes: 3 additions & 0 deletions packages/md-enhance/src/node/plugin.ts
Expand Up @@ -5,6 +5,7 @@ import {
addViteOptimizeDepsExclude,
addViteOptimizeDepsInclude,
addViteSsrExternal,
addViteSsrNoExternal,
getLocales,
} from "vuepress-shared";

Expand Down Expand Up @@ -153,6 +154,8 @@ export const mdEnhancePlugin =
},

extendsBundlerOptions: (config: unknown, app): void => {
addViteSsrNoExternal({ app, config }, "vuepress-shared");

if (katexOptions.output !== "html")
addCustomElement({ app, config }, MATHML_TAGS);

Expand Down
6 changes: 5 additions & 1 deletion packages/photo-swipe/src/node/plugin.ts
@@ -1,6 +1,6 @@
import { getDirname, path } from "@vuepress/utils";
import { useSassPalettePlugin } from "vuepress-plugin-sass-palette";
import { getLocales } from "vuepress-shared";
import { addViteSsrNoExternal, getLocales } from "vuepress-shared";

import { photoSwipeLocales } from "./locales.js";
import { logger } from "./utils.js";
Expand Down Expand Up @@ -45,6 +45,10 @@ export const photoSwipePlugin =
PHOTO_SWIPE_OPTIONS: options.options || {},
}),

extendsBundlerOptions: (config: unknown, app): void => {
addViteSsrNoExternal({ app, config }, "vuepress-shared");
},

clientConfigFile: path.resolve(__dirname, "../client/config.js"),
};
};
5 changes: 4 additions & 1 deletion packages/pwa2/src/node/plugin.ts
Expand Up @@ -57,7 +57,10 @@ export const pwaPlugin =
extendsBundlerOptions: (config: unknown, app): void => {
addViteOptimizeDepsInclude({ app, config }, "register-service-worker");

addViteSsrNoExternal({ app, config }, "register-service-worker");
addViteSsrNoExternal({ app, config }, [
"register-service-worker",
"vuepress-shared",
]);

useCustomDevServer(
config,
Expand Down

0 comments on commit 5450a9b

Please sign in to comment.