gant-core 0.1.24 → 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
@@ -6307,38 +6307,41 @@ class CopyFolderPlugin {
6307
6307
  }
6308
6308
 
6309
6309
  var getProConfig = (config, cwd) => {
6310
- const { outputPathDir = 'dist' } = config;
6310
+ const { outputPathDir = "dist", optimization } = config;
6311
6311
  return mergeConfig$1({
6312
- mode: 'production',
6312
+ mode: "production",
6313
6313
  optimization: {
6314
6314
  minimize: true,
6315
6315
  minimizer: [new CssMinimizerPlugin()],
6316
6316
  splitChunks: {
6317
- chunks: 'all',
6317
+ chunks: "all",
6318
6318
  minSize: 1000,
6319
6319
  minChunks: 1,
6320
6320
  cacheGroups: {
6321
6321
  vendors: {
6322
- name: 'vendors',
6322
+ name: "vendors",
6323
6323
  test: /[\\/]node_modules[\\/]/,
6324
6324
  priority: -10,
6325
6325
  reuseExistingChunk: true,
6326
6326
  },
6327
6327
  gant: {
6328
- name: 'gant',
6328
+ name: "gant",
6329
6329
  priority: -20,
6330
6330
  reuseExistingChunk: true,
6331
6331
  },
6332
+ ...get$3(optimization?.splitChunks, "cacheGroups", {}),
6332
6333
  },
6334
+ ...optimization?.splitChunks,
6333
6335
  },
6336
+ ...optimization,
6334
6337
  },
6335
6338
  plugins: [
6336
6339
  new MiniCssExtractPlugin$1(),
6337
6340
  new CopyFolderPlugin({
6338
6341
  patterns: [
6339
6342
  {
6340
- from: path$5.resolve(cwd, './src/.gant/public'),
6341
- to: path$5.resolve(cwd, outputPathDir, './public'),
6343
+ from: path$5.resolve(cwd, "./src/.gant/public"),
6344
+ to: path$5.resolve(cwd, outputPathDir),
6342
6345
  },
6343
6346
  ],
6344
6347
  }),
@@ -6602,9 +6605,9 @@ const getDefaultConfig = (cwd, config) => {
6602
6605
  }, webpackConfig);
6603
6606
  };
6604
6607
 
6605
- const ReactRefreshPlugin = require('@pmmmwh/react-refresh-webpack-plugin');
6608
+ const ReactRefreshPlugin = require("@pmmmwh/react-refresh-webpack-plugin");
6606
6609
  var _getDevlopmentConfig = (config, cwd) => {
6607
- const { base = '/', mpas } = config;
6610
+ const { base = "/", mpas } = config;
6608
6611
  const rewrites = [];
6609
6612
  mpas?.pages?.map((item) => {
6610
6613
  if (!isEmpty$2(item.paths)) {
@@ -6622,26 +6625,30 @@ var _getDevlopmentConfig = (config, cwd) => {
6622
6625
  });
6623
6626
  });
6624
6627
  return mergeConfig$1({
6625
- mode: 'development',
6628
+ mode: "development",
6626
6629
  devServer: {
6627
6630
  port: 8080,
6628
6631
  hot: true,
6629
6632
  open: true,
6630
6633
  client: { overlay: false },
6631
6634
  static: {
6632
- directory: path$5.resolve(cwd, 'src/.gant/public'),
6635
+ directory: path$5.resolve(cwd, "src/.gant/public"),
6633
6636
  publicPath: base,
6634
6637
  },
6635
6638
  compress: true,
6636
- historyApiFallback: has(config, 'customHistoryApiFallback')
6639
+ historyApiFallback: has(config, "customHistoryApiFallback")
6637
6640
  ? config?.customHistoryApiFallback
6638
6641
  : {
6639
- index: path$5.resolve(base, 'index.html'),
6642
+ index: path$5.resolve(base, "index.html"),
6640
6643
  rewrites: [
6641
6644
  {
6642
- from: /^\/public\/(.*)$/,
6645
+ from: new RegExp(`${base}public/(.*)`),
6643
6646
  to: (cxt) => {
6644
- 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; // 返回默认路径
6645
6652
  },
6646
6653
  ...rewrites,
6647
6654
  },
@@ -48717,7 +48724,7 @@ const createCwdConfig = (cwd, name, vue) => {
48717
48724
  };
48718
48725
 
48719
48726
  var name = "gant-core";
48720
- var version = "0.1.23";
48727
+ var version = "0.1.26";
48721
48728
  var description = "";
48722
48729
  var main = "lib/index.js";
48723
48730
  var bin = {