@rspress/core 1.7.5 → 1.8.1

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.js CHANGED
@@ -4354,12 +4354,12 @@ async function globalUIComponentsVMPlugin(context) {
4354
4354
  const moduleContent = globalComponents.map((source) => {
4355
4355
  const name = `Comp_${index}`;
4356
4356
  if (Array.isArray(source)) {
4357
- return `import ${name} from '${source[0]}';
4357
+ return `import ${name} from ${JSON.stringify(source[0])};
4358
4358
  const Props_${index++} = ${JSON.stringify(source[1])};
4359
4359
  `;
4360
4360
  } else {
4361
4361
  index++;
4362
- return `import ${name} from '${source}';
4362
+ return `import ${name} from ${JSON.stringify(source)};
4363
4363
  `;
4364
4364
  }
4365
4365
  }).concat(
@@ -4866,13 +4866,14 @@ async function createInternalBuildConfig(userDocRoot, config, isSSR, routeServic
4866
4866
  setupMiddlewares: [
4867
4867
  (middlewares) => {
4868
4868
  if (isPublicDirExist) {
4869
- middlewares.push(sirv(publicDir));
4869
+ middlewares.unshift(sirv(publicDir));
4870
4870
  }
4871
- middlewares.push(serveSearchIndexMiddleware(config));
4871
+ middlewares.unshift(serveSearchIndexMiddleware(config));
4872
4872
  }
4873
4873
  ]
4874
4874
  },
4875
4875
  html: {
4876
+ title: config?.title,
4876
4877
  favicon: normalizeIcon(config?.icon),
4877
4878
  template: path10.join(PACKAGE_ROOT, "index.html")
4878
4879
  },
@@ -5240,7 +5241,8 @@ async function bundle(docDirectory, config, pluginDriver, enableSSG) {
5240
5241
  output: {
5241
5242
  distPath: {
5242
5243
  root: `${outputDir}/ssr`
5243
- }
5244
+ },
5245
+ disableMinimize: true
5244
5246
  },
5245
5247
  tools: {
5246
5248
  rspack(options2) {
@@ -5320,7 +5322,7 @@ async function renderPages(appDirectory, config, pluginDriver, enableSSG) {
5320
5322
  helmet?.link?.toString(),
5321
5323
  helmet?.style?.toString(),
5322
5324
  helmet?.script?.toString(),
5323
- CHECK_DARK_LIGHT_SCRIPT
5325
+ config.themeConfig?.darkMode !== false ? CHECK_DARK_LIGHT_SCRIPT : ""
5324
5326
  ]).join("")
5325
5327
  );
5326
5328
  if (helmet?.htmlAttributes) {