Skip to content

Commit

Permalink
feat: refine plugin api
Browse files Browse the repository at this point in the history
  • Loading branch information
Mister-Hope committed Mar 2, 2022
1 parent 966a589 commit 22b1d93
Show file tree
Hide file tree
Showing 36 changed files with 636 additions and 418 deletions.
41 changes: 25 additions & 16 deletions docs/add-this/src/.vuepress/config.ts
Expand Up @@ -203,22 +203,31 @@ export default defineHopeConfig({

plugins: [
["add-this", { pubid: "ra-5f829c59e6c6bc9a" }],
(_options, app) => {
addViteOptimizeDepsInclude(app, [
"three",
"three/examples/jsm/controls/OrbitControls",
"three/examples/jsm/loaders/STLLoader",
]);

return {
name: "theme-enhance",
alias: {
"@theme-hope/components/HomeHero": path.resolve(
__dirname,
"./components/HopeHero"
),
},
};
{
name: "theme-enhance",
alias: {
"@theme-hope/components/HomeHero": path.resolve(
__dirname,
"./components/HopeHero"
),
},
onInitialized: (app) => {
if (app.env.isDev)
addViteOptimizeDepsInclude(app, [
"@mr-hope/vuepress-shared/lib/client",
"dayjs",
"dayjs/plugin/localizedFormat",
"dayjs/plugin/objectSupport",
"dayjs/plugin/timezone",
"dayjs/plugin/utc",
]);

addViteOptimizeDepsInclude(app, [
"three",
"three/examples/jsm/controls/OrbitControls",
"three/examples/jsm/loaders/STLLoader",
]);
},
},
],
});
41 changes: 25 additions & 16 deletions docs/blog2/src/.vuepress/config.ts
Expand Up @@ -171,22 +171,31 @@ export default defineHopeConfig({
},

plugins: [
(_options, app) => {
addViteOptimizeDepsInclude(app, [
"three",
"three/examples/jsm/controls/OrbitControls",
"three/examples/jsm/loaders/STLLoader",
]);

return {
name: "theme-enhance",
alias: {
"@theme-hope/components/HomeHero": path.resolve(
__dirname,
"./components/HopeHero"
),
},
};
{
name: "theme-enhance",
alias: {
"@theme-hope/components/HomeHero": path.resolve(
__dirname,
"./components/HopeHero"
),
},
onInitialized: (app) => {
if (app.env.isDev)
addViteOptimizeDepsInclude(app, [
"@mr-hope/vuepress-shared/lib/client",
"dayjs",
"dayjs/plugin/localizedFormat",
"dayjs/plugin/objectSupport",
"dayjs/plugin/timezone",
"dayjs/plugin/utc",
]);

addViteOptimizeDepsInclude(app, [
"three",
"three/examples/jsm/controls/OrbitControls",
"three/examples/jsm/loaders/STLLoader",
]);
},
},
],
});
39 changes: 24 additions & 15 deletions docs/comment2/src/.vuepress/config.ts
Expand Up @@ -248,22 +248,31 @@ export default defineHopeConfig({
},

plugins: [
(_options, app) => {
addViteOptimizeDepsInclude(app, [
"three",
"three/examples/jsm/controls/OrbitControls",
"three/examples/jsm/loaders/STLLoader",
]);
{
name: "theme-enhance",
alias: {
"@theme-hope/components/HomeHero": path.resolve(
__dirname,
"./components/HopeHero"
),
},
onInitialized: (app) => {
if (app.env.isDev)
addViteOptimizeDepsInclude(app, [
"@mr-hope/vuepress-shared/lib/client",
"dayjs",
"dayjs/plugin/localizedFormat",
"dayjs/plugin/objectSupport",
"dayjs/plugin/timezone",
"dayjs/plugin/utc",
]);

return {
name: "theme-enhance",
alias: {
"@theme-hope/components/HomeHero": path.resolve(
__dirname,
"./components/HopeHero"
),
},
};
addViteOptimizeDepsInclude(app, [
"three",
"three/examples/jsm/controls/OrbitControls",
"three/examples/jsm/loaders/STLLoader",
]);
},
},
],
});
41 changes: 25 additions & 16 deletions docs/components/src/.vuepress/config.ts
Expand Up @@ -194,22 +194,31 @@ export default defineHopeConfig({
},

plugins: [
(_options, app) => {
addViteOptimizeDepsInclude(app, [
"three",
"three/examples/jsm/controls/OrbitControls",
"three/examples/jsm/loaders/STLLoader",
]);

return {
name: "theme-enhance",
alias: {
"@theme-hope/components/HomeHero": path.resolve(
__dirname,
"./components/HopeHero"
),
},
};
{
name: "theme-enhance",
alias: {
"@theme-hope/components/HomeHero": path.resolve(
__dirname,
"./components/HopeHero"
),
},
onInitialized: (app) => {
if (app.env.isDev)
addViteOptimizeDepsInclude(app, [
"@mr-hope/vuepress-shared/lib/client",
"dayjs",
"dayjs/plugin/localizedFormat",
"dayjs/plugin/objectSupport",
"dayjs/plugin/timezone",
"dayjs/plugin/utc",
]);

addViteOptimizeDepsInclude(app, [
"three",
"three/examples/jsm/controls/OrbitControls",
"three/examples/jsm/loaders/STLLoader",
]);
},
},
],
});
41 changes: 25 additions & 16 deletions docs/copy-code2/src/.vuepress/config.ts
Expand Up @@ -203,22 +203,31 @@ export default defineHopeConfig({
},

plugins: [
(_options, app) => {
addViteOptimizeDepsInclude(app, [
"three",
"three/examples/jsm/controls/OrbitControls",
"three/examples/jsm/loaders/STLLoader",
]);

return {
name: "theme-enhance",
alias: {
"@theme-hope/components/HomeHero": path.resolve(
__dirname,
"./components/HopeHero"
),
},
};
{
name: "theme-enhance",
alias: {
"@theme-hope/components/HomeHero": path.resolve(
__dirname,
"./components/HopeHero"
),
},
onInitialized: (app) => {
if (app.env.isDev)
addViteOptimizeDepsInclude(app, [
"@mr-hope/vuepress-shared/lib/client",
"dayjs",
"dayjs/plugin/localizedFormat",
"dayjs/plugin/objectSupport",
"dayjs/plugin/timezone",
"dayjs/plugin/utc",
]);

addViteOptimizeDepsInclude(app, [
"three",
"three/examples/jsm/controls/OrbitControls",
"three/examples/jsm/loaders/STLLoader",
]);
},
},
],
});
41 changes: 25 additions & 16 deletions docs/feed2/src/.vuepress/config.ts
Expand Up @@ -231,22 +231,31 @@ export default defineHopeConfig({
},

plugins: [
(_options, app) => {
addViteOptimizeDepsInclude(app, [
"three",
"three/examples/jsm/controls/OrbitControls",
"three/examples/jsm/loaders/STLLoader",
]);

return {
name: "theme-enhance",
alias: {
"@theme-hope/components/HomeHero": path.resolve(
__dirname,
"./components/HopeHero"
),
},
};
{
name: "theme-enhance",
alias: {
"@theme-hope/components/HomeHero": path.resolve(
__dirname,
"./components/HopeHero"
),
},
onInitialized: (app) => {
if (app.env.isDev)
addViteOptimizeDepsInclude(app, [
"@mr-hope/vuepress-shared/lib/client",
"dayjs",
"dayjs/plugin/localizedFormat",
"dayjs/plugin/objectSupport",
"dayjs/plugin/timezone",
"dayjs/plugin/utc",
]);

addViteOptimizeDepsInclude(app, [
"three",
"three/examples/jsm/controls/OrbitControls",
"three/examples/jsm/loaders/STLLoader",
]);
},
},
],
});
41 changes: 25 additions & 16 deletions docs/lightgallery/src/.vuepress/config.ts
Expand Up @@ -177,22 +177,31 @@ export default defineHopeConfig({

plugins: [
["lightgallery", { selector: ".theme-hope-content :not(a) > img" }],
(_options, app) => {
addViteOptimizeDepsInclude(app, [
"three",
"three/examples/jsm/controls/OrbitControls",
"three/examples/jsm/loaders/STLLoader",
]);

return {
name: "theme-enhance",
alias: {
"@theme-hope/components/HomeHero": path.resolve(
__dirname,
"./components/HopeHero"
),
},
};
{
name: "theme-enhance",
alias: {
"@theme-hope/components/HomeHero": path.resolve(
__dirname,
"./components/HopeHero"
),
},
onInitialized: (app) => {
if (app.env.isDev)
addViteOptimizeDepsInclude(app, [
"@mr-hope/vuepress-shared/lib/client",
"dayjs",
"dayjs/plugin/localizedFormat",
"dayjs/plugin/objectSupport",
"dayjs/plugin/timezone",
"dayjs/plugin/utc",
]);

addViteOptimizeDepsInclude(app, [
"three",
"three/examples/jsm/controls/OrbitControls",
"three/examples/jsm/loaders/STLLoader",
]);
},
},
],
});
39 changes: 24 additions & 15 deletions docs/md-enhance/src/.vuepress/config.ts
Expand Up @@ -351,22 +351,31 @@ export default defineHopeConfig({
},
},
],
(_options, app) => {
addViteOptimizeDepsInclude(app, [
"three",
"three/examples/jsm/controls/OrbitControls",
"three/examples/jsm/loaders/STLLoader",
]);
{
name: "theme-enhance",
alias: {
"@theme-hope/components/HomeHero": path.resolve(
__dirname,
"./components/HopeHero"
),
},
onInitialized: (app) => {
if (app.env.isDev)
addViteOptimizeDepsInclude(app, [
"@mr-hope/vuepress-shared/lib/client",
"dayjs",
"dayjs/plugin/localizedFormat",
"dayjs/plugin/objectSupport",
"dayjs/plugin/timezone",
"dayjs/plugin/utc",
]);

return {
name: "theme-enhance",
alias: {
"@theme-hope/components/HomeHero": path.resolve(
__dirname,
"./components/HopeHero"
),
},
};
addViteOptimizeDepsInclude(app, [
"three",
"three/examples/jsm/controls/OrbitControls",
"three/examples/jsm/loaders/STLLoader",
]);
},
},
],
});

0 comments on commit 22b1d93

Please sign in to comment.