@rspress/core 1.2.1 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +2 -0
- package/dist/index.js +53 -40
- package/dist/index.js.map +1 -1
- package/dist/loader.d.ts +1 -1
- package/dist/loader.js.map +1 -1
- package/dist/runtime/App.js +8 -4
- package/dist/runtime/clientEntry.js +7 -4
- package/dist/runtime/ssrEntry.js +2 -2
- package/package.json +19 -15
- package/runtime.ts +1 -1
- package/src/runtime/App.tsx +8 -4
- package/src/runtime/clientEntry.tsx +7 -4
- package/src/runtime/ssrEntry.tsx +2 -2
- package/theme.ts +2 -2
- package/dist/runtime/Content.d.ts +0 -6
- package/dist/runtime/Content.js +0 -33
- package/dist/runtime/NoSSR.d.ts +0 -4
- package/dist/runtime/NoSSR.js +0 -17
- package/dist/runtime/hooks.d.ts +0 -39
- package/dist/runtime/hooks.js +0 -54
- package/dist/runtime/index.d.ts +0 -6
- package/dist/runtime/index.js +0 -34
- package/dist/runtime/utils.d.ts +0 -8
- package/dist/runtime/utils.js +0 -45
- package/dist/theme/bundle.css +0 -2691
- package/dist/theme/bundle.d.ts +0 -176
- package/dist/theme/bundle.js +0 -4433
- package/dist/theme/bundle.js.map +0 -1
- package/dist/theme/index.js +0 -6
- package/src/runtime/Content.tsx +0 -43
- package/src/runtime/NoSSR.tsx +0 -16
- package/src/runtime/hooks.ts +0 -110
- package/src/runtime/index.ts +0 -17
- package/src/runtime/utils.ts +0 -46
- package/src/theme-default/assets/arrow-down.svg +0 -1
- package/src/theme-default/assets/arrow-right.svg +0 -1
- package/src/theme-default/assets/copy.svg +0 -1
- package/src/theme-default/assets/down.svg +0 -1
- package/src/theme-default/assets/github.svg +0 -1
- package/src/theme-default/assets/loading.svg +0 -1
- package/src/theme-default/assets/menu.svg +0 -1
- package/src/theme-default/assets/moon.svg +0 -3
- package/src/theme-default/assets/right.svg +0 -1
- package/src/theme-default/assets/small-menu.svg +0 -1
- package/src/theme-default/assets/success.svg +0 -1
- package/src/theme-default/assets/sun.svg +0 -11
- package/src/theme-default/assets/translator.svg +0 -1
- package/src/theme-default/components/Aside/index.css +0 -22
- package/src/theme-default/components/Aside/index.tsx +0 -75
- package/src/theme-default/components/BackDrop/index.module.scss +0 -14
- package/src/theme-default/components/BackDrop/index.tsx +0 -13
- package/src/theme-default/components/Button/index.module.scss +0 -68
- package/src/theme-default/components/Button/index.tsx +0 -40
- package/src/theme-default/components/DocFooter/index.module.scss +0 -60
- package/src/theme-default/components/DocFooter/index.tsx +0 -66
- package/src/theme-default/components/EditLink/index.module.scss +0 -11
- package/src/theme-default/components/EditLink/index.tsx +0 -18
- package/src/theme-default/components/HomeFeatures/index.module.scss +0 -50
- package/src/theme-default/components/HomeFeatures/index.tsx +0 -65
- package/src/theme-default/components/HomeFooter/index.tsx +0 -15
- package/src/theme-default/components/HomeHero/index.module.scss +0 -42
- package/src/theme-default/components/HomeHero/index.tsx +0 -75
- package/src/theme-default/components/Link/index.module.scss +0 -9
- package/src/theme-default/components/Link/index.tsx +0 -90
- package/src/theme-default/components/LocalSideBar/index.scss +0 -40
- package/src/theme-default/components/LocalSideBar/index.tsx +0 -39
- package/src/theme-default/components/Nav/NavBarTitle.tsx +0 -43
- package/src/theme-default/components/Nav/NavMenuGroup.tsx +0 -156
- package/src/theme-default/components/Nav/NavMenuSingleItem.tsx +0 -40
- package/src/theme-default/components/Nav/NavTranslations.tsx +0 -16
- package/src/theme-default/components/Nav/NavVersions.tsx +0 -16
- package/src/theme-default/components/Nav/index.module.scss +0 -115
- package/src/theme-default/components/Nav/index.tsx +0 -150
- package/src/theme-default/components/Nav/menuDataHooks.tsx +0 -75
- package/src/theme-default/components/NavHambmger/index.module.scss +0 -81
- package/src/theme-default/components/NavHambmger/index.tsx +0 -39
- package/src/theme-default/components/NavScreen/NavScreenMenuGroup.tsx +0 -95
- package/src/theme-default/components/NavScreen/index.module.scss +0 -88
- package/src/theme-default/components/NavScreen/index.tsx +0 -123
- package/src/theme-default/components/Overview/index.module.scss +0 -154
- package/src/theme-default/components/Overview/index.tsx +0 -136
- package/src/theme-default/components/PackageManagerTabs/icons/Bun.tsx +0 -101
- package/src/theme-default/components/PackageManagerTabs/icons/Npm.tsx +0 -16
- package/src/theme-default/components/PackageManagerTabs/icons/Pnpm.tsx +0 -22
- package/src/theme-default/components/PackageManagerTabs/icons/Yarn.tsx +0 -18
- package/src/theme-default/components/PackageManagerTabs/index.scss +0 -5
- package/src/theme-default/components/PackageManagerTabs/index.tsx +0 -110
- package/src/theme-default/components/Search/NoSearchResult.tsx +0 -13
- package/src/theme-default/components/Search/SearchPanel.tsx +0 -340
- package/src/theme-default/components/Search/SuggestItem.tsx +0 -135
- package/src/theme-default/components/Search/assets/close.svg +0 -1
- package/src/theme-default/components/Search/assets/file.svg +0 -1
- package/src/theme-default/components/Search/assets/header.svg +0 -1
- package/src/theme-default/components/Search/assets/jump.svg +0 -1
- package/src/theme-default/components/Search/assets/loading.svg +0 -1
- package/src/theme-default/components/Search/assets/search.svg +0 -1
- package/src/theme-default/components/Search/assets/title.svg +0 -1
- package/src/theme-default/components/Search/empty.svg +0 -4
- package/src/theme-default/components/Search/index.module.scss +0 -236
- package/src/theme-default/components/Search/index.tsx +0 -39
- package/src/theme-default/components/Search/logic/Provider.ts +0 -35
- package/src/theme-default/components/Search/logic/providers/LocalProvider.ts +0 -102
- package/src/theme-default/components/Search/logic/providers/RemoteProvider.ts +0 -40
- package/src/theme-default/components/Search/logic/search.ts +0 -341
- package/src/theme-default/components/Search/logic/util.test.ts +0 -21
- package/src/theme-default/components/Search/logic/util.ts +0 -127
- package/src/theme-default/components/Sidebar/SidebarGroup.tsx +0 -180
- package/src/theme-default/components/Sidebar/SidebarItem.tsx +0 -61
- package/src/theme-default/components/Sidebar/index.module.scss +0 -142
- package/src/theme-default/components/Sidebar/index.tsx +0 -156
- package/src/theme-default/components/SocialLinks/HiddenLinks.tsx +0 -30
- package/src/theme-default/components/SocialLinks/LinkContent.tsx +0 -90
- package/src/theme-default/components/SocialLinks/ShownLinks.tsx +0 -32
- package/src/theme-default/components/SocialLinks/index.module.scss +0 -18
- package/src/theme-default/components/SocialLinks/index.tsx +0 -36
- package/src/theme-default/components/SocialLinks/presetIcons.tsx +0 -165
- package/src/theme-default/components/SwitchAppearance/index.module.scss +0 -15
- package/src/theme-default/components/SwitchAppearance/index.tsx +0 -35
- package/src/theme-default/components/Tabs/index.module.scss +0 -46
- package/src/theme-default/components/Tabs/index.tsx +0 -123
- package/src/theme-default/components/Tag/index.tsx +0 -18
- package/src/theme-default/components/Toc/index.css +0 -18
- package/src/theme-default/components/Toc/index.tsx +0 -42
- package/src/theme-default/index.ts +0 -26
- package/src/theme-default/layout/DocLayout/docComponents/code.tsx +0 -112
- package/src/theme-default/layout/DocLayout/docComponents/hr.tsx +0 -10
- package/src/theme-default/layout/DocLayout/docComponents/index.module.scss +0 -69
- package/src/theme-default/layout/DocLayout/docComponents/index.tsx +0 -33
- package/src/theme-default/layout/DocLayout/docComponents/link.tsx +0 -22
- package/src/theme-default/layout/DocLayout/docComponents/list.tsx +0 -13
- package/src/theme-default/layout/DocLayout/docComponents/paragraph.tsx +0 -19
- package/src/theme-default/layout/DocLayout/docComponents/pre.tsx +0 -37
- package/src/theme-default/layout/DocLayout/docComponents/prisim-theme.ts +0 -73
- package/src/theme-default/layout/DocLayout/docComponents/table.tsx +0 -37
- package/src/theme-default/layout/DocLayout/docComponents/title.tsx +0 -40
- package/src/theme-default/layout/DocLayout/index.module.scss +0 -138
- package/src/theme-default/layout/DocLayout/index.tsx +0 -125
- package/src/theme-default/layout/HomeLayout/index.css +0 -18
- package/src/theme-default/layout/HomeLayout/index.tsx +0 -39
- package/src/theme-default/layout/Layout/index.tsx +0 -176
- package/src/theme-default/layout/NotFountLayout/index.tsx +0 -40
- package/src/theme-default/logic/TabDataContext.ts +0 -14
- package/src/theme-default/logic/index.ts +0 -8
- package/src/theme-default/logic/sideEffects.ts +0 -174
- package/src/theme-default/logic/useAppearance.ts +0 -57
- package/src/theme-default/logic/useEditLink.ts +0 -33
- package/src/theme-default/logic/useHiddenNav.ts +0 -58
- package/src/theme-default/logic/useLocaleSiteData.ts +0 -26
- package/src/theme-default/logic/useNav.ts +0 -36
- package/src/theme-default/logic/usePathUtils.ts +0 -73
- package/src/theme-default/logic/usePrevNextPage.ts +0 -40
- package/src/theme-default/logic/useSidebarData.ts +0 -73
- package/src/theme-default/logic/utils.ts +0 -38
- package/src/theme-default/styles/base.css +0 -102
- package/src/theme-default/styles/code.css +0 -177
- package/src/theme-default/styles/index.ts +0 -7
- package/src/theme-default/styles/scrollbar.css +0 -28
- package/src/theme-default/styles/vars.css +0 -81
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { UserConfig } from '@rspress/shared';
|
|
2
2
|
export * from '@rspress/shared';
|
|
3
|
+
import { RsbuildConfig } from '@rsbuild/core';
|
|
3
4
|
|
|
4
5
|
interface ServerInstance {
|
|
5
6
|
close: () => Promise<void>;
|
|
@@ -8,6 +9,7 @@ interface DevOptions {
|
|
|
8
9
|
appDirectory: string;
|
|
9
10
|
docDirectory: string;
|
|
10
11
|
config: UserConfig;
|
|
12
|
+
extraBuilderConfig?: RsbuildConfig;
|
|
11
13
|
}
|
|
12
14
|
declare function dev(options: DevOptions): Promise<ServerInstance>;
|
|
13
15
|
|
package/dist/index.js
CHANGED
|
@@ -3623,10 +3623,11 @@ var require_gray_matter = __commonJS({
|
|
|
3623
3623
|
import { removeLeadingSlash as removeLeadingSlash2 } from "@rspress/shared";
|
|
3624
3624
|
import { logger as logger4 } from "@rspress/shared/logger";
|
|
3625
3625
|
|
|
3626
|
-
// src/node/
|
|
3626
|
+
// src/node/initRsbuild.ts
|
|
3627
3627
|
import path9 from "path";
|
|
3628
3628
|
import fs8 from "@modern-js/utils/fs-extra";
|
|
3629
3629
|
import {
|
|
3630
|
+
MDX_REGEXP as MDX_REGEXP3,
|
|
3630
3631
|
RSPRESS_TEMP_DIR as RSPRESS_TEMP_DIR2,
|
|
3631
3632
|
isDebugMode,
|
|
3632
3633
|
removeTrailingSlash
|
|
@@ -4448,10 +4449,10 @@ var runtimeModuleFactory = [
|
|
|
4448
4449
|
*/
|
|
4449
4450
|
prismLanguageVMPlugin
|
|
4450
4451
|
];
|
|
4451
|
-
function
|
|
4452
|
+
function rsbuildPluginDocVM(factoryContext) {
|
|
4452
4453
|
const { pluginDriver } = factoryContext;
|
|
4453
4454
|
return {
|
|
4454
|
-
name: "
|
|
4455
|
+
name: "rsbuild-plugin-doc-vm",
|
|
4455
4456
|
setup(api) {
|
|
4456
4457
|
api.modifyBundlerChain(async (bundlerChain) => {
|
|
4457
4458
|
const alias = bundlerChain.resolve.alias.entries();
|
|
@@ -4634,7 +4635,7 @@ var RouteService = class {
|
|
|
4634
4635
|
...__privateGet(this, _exclude),
|
|
4635
4636
|
"**/node_modules/**",
|
|
4636
4637
|
"**/.eslintrc.js",
|
|
4637
|
-
"**/.
|
|
4638
|
+
"**/.nx-cache/**"
|
|
4638
4639
|
]
|
|
4639
4640
|
}).sort();
|
|
4640
4641
|
files.forEach((filePath) => {
|
|
@@ -4791,7 +4792,7 @@ async function initRouteService(options2) {
|
|
|
4791
4792
|
return routeService;
|
|
4792
4793
|
}
|
|
4793
4794
|
|
|
4794
|
-
// src/node/
|
|
4795
|
+
// src/node/initRsbuild.ts
|
|
4795
4796
|
async function createInternalBuildConfig(userDocRoot, config, isSSR, routeService2, pluginDriver) {
|
|
4796
4797
|
const cwd = process.cwd();
|
|
4797
4798
|
const { default: fs10 } = await import("@modern-js/utils/fs-extra");
|
|
@@ -4830,17 +4831,17 @@ async function createInternalBuildConfig(userDocRoot, config, isSSR, routeServic
|
|
|
4830
4831
|
},
|
|
4831
4832
|
html: {
|
|
4832
4833
|
favicon: normalizeIcon(config?.icon),
|
|
4833
|
-
template: path9.join(PACKAGE_ROOT, "index.html")
|
|
4834
|
+
template: path9.join(PACKAGE_ROOT, "index.html"),
|
|
4835
|
+
outputStructure: "nested"
|
|
4834
4836
|
},
|
|
4835
4837
|
output: {
|
|
4836
4838
|
distPath: {
|
|
4837
|
-
// `root` must be a relative path in
|
|
4838
|
-
root: path9.isAbsolute(outDir) ? path9.relative(cwd, outDir) : outDir
|
|
4839
|
+
// `root` must be a relative path in Rsbuild
|
|
4840
|
+
root: path9.isAbsolute(outDir) ? path9.relative(cwd, outDir) : outDir,
|
|
4841
|
+
html: "html"
|
|
4839
4842
|
},
|
|
4840
4843
|
// TODO: switch to 'usage' if Rspack supports it
|
|
4841
4844
|
polyfill: "entry",
|
|
4842
|
-
svgDefaultExport: "component",
|
|
4843
|
-
disableTsChecker: true,
|
|
4844
4845
|
// Disable production source map, it is useless for doc site
|
|
4845
4846
|
disableSourceMap: isProduction(),
|
|
4846
4847
|
overrideBrowserslist: browserslist,
|
|
@@ -4849,7 +4850,6 @@ async function createInternalBuildConfig(userDocRoot, config, isSSR, routeServic
|
|
|
4849
4850
|
source: {
|
|
4850
4851
|
alias: {
|
|
4851
4852
|
"@mdx-js/react": __require.resolve("@mdx-js/react"),
|
|
4852
|
-
"@/runtime": path9.join(PACKAGE_ROOT, "dist", "runtime"),
|
|
4853
4853
|
"@theme": themeDir,
|
|
4854
4854
|
"@/theme-default": DEFAULT_THEME_DIR,
|
|
4855
4855
|
"@rspress/core": PACKAGE_ROOT,
|
|
@@ -4859,7 +4859,12 @@ async function createInternalBuildConfig(userDocRoot, config, isSSR, routeServic
|
|
|
4859
4859
|
),
|
|
4860
4860
|
...await resolveReactAlias(reactVersion)
|
|
4861
4861
|
},
|
|
4862
|
-
include: [
|
|
4862
|
+
include: [
|
|
4863
|
+
PACKAGE_ROOT,
|
|
4864
|
+
path9.join(cwd, "node_modules", RSPRESS_TEMP_DIR2),
|
|
4865
|
+
// To compile components/MediumZoom.tsx
|
|
4866
|
+
/[\\/]plugin-medium-zoom/
|
|
4867
|
+
],
|
|
4863
4868
|
define: {
|
|
4864
4869
|
"process.env.__ASSET_PREFIX__": JSON.stringify(assetPrefix),
|
|
4865
4870
|
"process.env.__SSR__": JSON.stringify(isSSR),
|
|
@@ -4894,8 +4899,9 @@ async function createInternalBuildConfig(userDocRoot, config, isSSR, routeServic
|
|
|
4894
4899
|
);
|
|
4895
4900
|
}
|
|
4896
4901
|
},
|
|
4897
|
-
bundlerChain(chain) {
|
|
4898
|
-
chain.module.rule(
|
|
4902
|
+
bundlerChain(chain, { CHAIN_ID }) {
|
|
4903
|
+
const swcLoaderOptions = chain.module.rule(CHAIN_ID.RULE.JS).use(CHAIN_ID.USE.SWC).get("options");
|
|
4904
|
+
chain.module.rule("MDX").type("javascript/auto").test(MDX_REGEXP3).oneOf("MDXCompile").use("builtin:swc-loader").loader("builtin:swc-loader").options(swcLoaderOptions).end().use("mdx-loader").loader(__require.resolve("../loader.cjs")).options({
|
|
4899
4905
|
config,
|
|
4900
4906
|
docDirectory: userDocRoot,
|
|
4901
4907
|
checkDeadLinks,
|
|
@@ -4905,12 +4911,19 @@ async function createInternalBuildConfig(userDocRoot, config, isSSR, routeServic
|
|
|
4905
4911
|
}).end().use("string-replace-loader").loader(__require.resolve("string-replace-loader")).options({
|
|
4906
4912
|
multiple: config?.replaceRules || []
|
|
4907
4913
|
});
|
|
4914
|
+
if (chain.plugins.has(CHAIN_ID.PLUGIN.REACT_FAST_REFRESH)) {
|
|
4915
|
+
chain.plugin(CHAIN_ID.PLUGIN.REACT_FAST_REFRESH).tap((options2) => {
|
|
4916
|
+
options2[0] ?? (options2[0] = {});
|
|
4917
|
+
options2[0].include = [/\.([cm]js|[jt]sx?|flow)$/i, MDX_REGEXP3];
|
|
4918
|
+
return options2;
|
|
4919
|
+
});
|
|
4920
|
+
}
|
|
4908
4921
|
chain.resolve.extensions.prepend(".md").prepend(".mdx").prepend(".mjs");
|
|
4909
4922
|
}
|
|
4910
4923
|
}
|
|
4911
4924
|
};
|
|
4912
4925
|
}
|
|
4913
|
-
async function
|
|
4926
|
+
async function initRsbuild(rootDir, config, pluginDriver, isSSR = false, extraRsbuildConfig) {
|
|
4914
4927
|
const cwd = process.cwd();
|
|
4915
4928
|
const userDocRoot = path9.resolve(rootDir || config?.root || cwd);
|
|
4916
4929
|
const builderPlugins = config?.builderPlugins ?? [];
|
|
@@ -4924,35 +4937,31 @@ async function createModernBuilder(rootDir, config, pluginDriver, isSSR = false,
|
|
|
4924
4937
|
pluginDriver
|
|
4925
4938
|
});
|
|
4926
4939
|
const {
|
|
4927
|
-
default: {
|
|
4928
|
-
} = await import("@
|
|
4929
|
-
const {
|
|
4930
|
-
|
|
4931
|
-
|
|
4932
|
-
const internalBuilderConfig = await createInternalBuildConfig(
|
|
4940
|
+
default: { createRsbuild, mergeRsbuildConfig }
|
|
4941
|
+
} = await import("@rsbuild/core");
|
|
4942
|
+
const { pluginReact } = await import("@rsbuild/plugin-react");
|
|
4943
|
+
const { pluginSvgr } = await import("@rsbuild/plugin-svgr");
|
|
4944
|
+
const internalRsbuildConfig = await createInternalBuildConfig(
|
|
4933
4945
|
userDocRoot,
|
|
4934
4946
|
config,
|
|
4935
4947
|
isSSR,
|
|
4936
4948
|
routeService2,
|
|
4937
4949
|
pluginDriver
|
|
4938
4950
|
);
|
|
4939
|
-
const
|
|
4940
|
-
builderConfig: mergeBuilderConfig(
|
|
4941
|
-
internalBuilderConfig,
|
|
4942
|
-
...config?.plugins?.map((plugin) => plugin.builderConfig ?? {}) || [],
|
|
4943
|
-
config?.builderConfig || {},
|
|
4944
|
-
extraBuilderConfig || {}
|
|
4945
|
-
)
|
|
4946
|
-
});
|
|
4947
|
-
const builder = await createBuilder(builderProvider, {
|
|
4951
|
+
const rsbuild = await createRsbuild({
|
|
4948
4952
|
target: isSSR ? "node" : "web",
|
|
4949
4953
|
entry: {
|
|
4950
4954
|
main: isSSR ? SSR_ENTRY : CLIENT_ENTRY
|
|
4951
4955
|
},
|
|
4952
|
-
|
|
4956
|
+
rsbuildConfig: mergeRsbuildConfig(
|
|
4957
|
+
internalRsbuildConfig,
|
|
4958
|
+
...config?.plugins?.map((plugin) => plugin.builderConfig ?? {}) || [],
|
|
4959
|
+
config?.builderConfig || {},
|
|
4960
|
+
extraRsbuildConfig || {}
|
|
4961
|
+
)
|
|
4953
4962
|
});
|
|
4954
|
-
|
|
4955
|
-
|
|
4963
|
+
rsbuild.addPlugins([
|
|
4964
|
+
rsbuildPluginDocVM({
|
|
4956
4965
|
userDocRoot,
|
|
4957
4966
|
config,
|
|
4958
4967
|
isSSR,
|
|
@@ -4960,9 +4969,13 @@ async function createModernBuilder(rootDir, config, pluginDriver, isSSR = false,
|
|
|
4960
4969
|
routeService: routeService2,
|
|
4961
4970
|
pluginDriver
|
|
4962
4971
|
}),
|
|
4972
|
+
pluginReact(),
|
|
4973
|
+
pluginSvgr({
|
|
4974
|
+
svgDefaultExport: "component"
|
|
4975
|
+
}),
|
|
4963
4976
|
...builderPlugins
|
|
4964
4977
|
]);
|
|
4965
|
-
return
|
|
4978
|
+
return rsbuild;
|
|
4966
4979
|
}
|
|
4967
4980
|
|
|
4968
4981
|
// src/node/PluginDriver.ts
|
|
@@ -5135,7 +5148,7 @@ _isProd = new WeakMap();
|
|
|
5135
5148
|
|
|
5136
5149
|
// src/node/dev.ts
|
|
5137
5150
|
async function dev(options2) {
|
|
5138
|
-
const { docDirectory, config } = options2;
|
|
5151
|
+
const { docDirectory, config, extraBuilderConfig } = options2;
|
|
5139
5152
|
const base = config?.base ?? "";
|
|
5140
5153
|
const isProd = false;
|
|
5141
5154
|
const pluginDriver = new PluginDriver(config, isProd);
|
|
@@ -5143,12 +5156,12 @@ async function dev(options2) {
|
|
|
5143
5156
|
try {
|
|
5144
5157
|
const modifiedConfig = await pluginDriver.modifyConfig();
|
|
5145
5158
|
await pluginDriver.beforeBuild();
|
|
5146
|
-
const builder = await
|
|
5159
|
+
const builder = await initRsbuild(
|
|
5147
5160
|
docDirectory,
|
|
5148
5161
|
modifiedConfig,
|
|
5149
5162
|
pluginDriver,
|
|
5150
5163
|
false,
|
|
5151
|
-
|
|
5164
|
+
extraBuilderConfig
|
|
5152
5165
|
);
|
|
5153
5166
|
const { server } = await builder.startDevServer({
|
|
5154
5167
|
printURLs: (urls) => {
|
|
@@ -5195,8 +5208,8 @@ async function bundle(docDirectory, config, pluginDriver, enableSSG) {
|
|
|
5195
5208
|
const outputDir = config?.outDir ?? OUTPUT_DIR;
|
|
5196
5209
|
if (enableSSG) {
|
|
5197
5210
|
const [clientBuilder, ssrBuilder] = await Promise.all([
|
|
5198
|
-
|
|
5199
|
-
|
|
5211
|
+
initRsbuild(docDirectory, config, pluginDriver, false),
|
|
5212
|
+
initRsbuild(docDirectory, config, pluginDriver, true, {
|
|
5200
5213
|
output: {
|
|
5201
5214
|
distPath: {
|
|
5202
5215
|
root: `${outputDir}/ssr`
|
|
@@ -5206,7 +5219,7 @@ async function bundle(docDirectory, config, pluginDriver, enableSSG) {
|
|
|
5206
5219
|
]);
|
|
5207
5220
|
await Promise.all([clientBuilder.build(), ssrBuilder.build()]);
|
|
5208
5221
|
} else {
|
|
5209
|
-
const clientBuilder = await
|
|
5222
|
+
const clientBuilder = await initRsbuild(
|
|
5210
5223
|
docDirectory,
|
|
5211
5224
|
config,
|
|
5212
5225
|
pluginDriver,
|