gant-core 0.1.25 → 0.1.26

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/lib/cli/index.js CHANGED
@@ -6341,7 +6341,7 @@ var getProConfig = (config, cwd) => {
6341
6341
  patterns: [
6342
6342
  {
6343
6343
  from: path$5.resolve(cwd, "./src/.gant/public"),
6344
- to: path$5.resolve(cwd, outputPathDir, "./public"),
6344
+ to: path$5.resolve(cwd, outputPathDir),
6345
6345
  },
6346
6346
  ],
6347
6347
  }),
@@ -6605,9 +6605,9 @@ const getDefaultConfig = (cwd, config) => {
6605
6605
  }, webpackConfig);
6606
6606
  };
6607
6607
 
6608
- const ReactRefreshPlugin = require('@pmmmwh/react-refresh-webpack-plugin');
6608
+ const ReactRefreshPlugin = require("@pmmmwh/react-refresh-webpack-plugin");
6609
6609
  var _getDevlopmentConfig = (config, cwd) => {
6610
- const { base = '/', mpas } = config;
6610
+ const { base = "/", mpas } = config;
6611
6611
  const rewrites = [];
6612
6612
  mpas?.pages?.map((item) => {
6613
6613
  if (!isEmpty$2(item.paths)) {
@@ -6625,26 +6625,30 @@ var _getDevlopmentConfig = (config, cwd) => {
6625
6625
  });
6626
6626
  });
6627
6627
  return mergeConfig$1({
6628
- mode: 'development',
6628
+ mode: "development",
6629
6629
  devServer: {
6630
6630
  port: 8080,
6631
6631
  hot: true,
6632
6632
  open: true,
6633
6633
  client: { overlay: false },
6634
6634
  static: {
6635
- directory: path$5.resolve(cwd, 'src/.gant/public'),
6635
+ directory: path$5.resolve(cwd, "src/.gant/public"),
6636
6636
  publicPath: base,
6637
6637
  },
6638
6638
  compress: true,
6639
- historyApiFallback: has(config, 'customHistoryApiFallback')
6639
+ historyApiFallback: has(config, "customHistoryApiFallback")
6640
6640
  ? config?.customHistoryApiFallback
6641
6641
  : {
6642
- index: path$5.resolve(base, 'index.html'),
6642
+ index: path$5.resolve(base, "index.html"),
6643
6643
  rewrites: [
6644
6644
  {
6645
- from: /^\/public\/(.*)$/,
6645
+ from: new RegExp(`${base}public/(.*)`),
6646
6646
  to: (cxt) => {
6647
- return path$5.resolve(base, cxt.match[1]);
6647
+ if (cxt.match && cxt.match[1]) {
6648
+ // 确保匹配组存在
6649
+ return path$5.resolve(base, cxt.match[1]);
6650
+ }
6651
+ return base; // 返回默认路径
6648
6652
  },
6649
6653
  ...rewrites,
6650
6654
  },
@@ -48720,7 +48724,7 @@ const createCwdConfig = (cwd, name, vue) => {
48720
48724
  };
48721
48725
 
48722
48726
  var name = "gant-core";
48723
- var version = "0.1.25";
48727
+ var version = "0.1.26";
48724
48728
  var description = "";
48725
48729
  var main = "lib/index.js";
48726
48730
  var bin = {