@cloudbase/lowcode-builder 1.10.24 → 1.10.28

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.
@@ -100,13 +100,13 @@ module.exports = function (options) {
100
100
  }),
101
101
  new webpack.IgnorePlugin(/^\.\/locale$/, /moment$/),
102
102
  new webpack.NormalModuleReplacementPlugin(
103
- /@\/components\/(?!ui)(.*)|^@\/components$/, // 使用否定前瞻匹配除ui外的所有路径
103
+ /@\/components\/(?!ui)(.*)|^@\/(lib|hooks|configs)|^@\/components$/, // 使用否定前瞻匹配除ui外的所有路径
104
104
  function (resource) {
105
- if (/lowcode\/(pages|components)/.test(resource.context)) {
106
- if (/\@\/components\/(.*)/.test(resource.request)) {
107
- resource.request = resource.request.replace(/\@\/components\/(.*)/, '@/lowcode/components/$1');
108
- } else if (resource.request === '@/components') {
105
+ if (/lowcode\//.test(resource.context)) {
106
+ if (resource.request === '@/components') {
109
107
  resource.request = '@/lowcode/components/index';
108
+ } else {
109
+ resource.request = resource.request.replace(/\@\//, '@/lowcode/');
110
110
  }
111
111
  }
112
112
  },
@@ -203,6 +203,7 @@ module.exports = function (options) {
203
203
  });
204
204
  }
205
205
 
206
+ let hasUtils = false;
206
207
  return {
207
208
  context,
208
209
  entry: './src/index.jsx',
@@ -236,6 +237,9 @@ module.exports = function (options) {
236
237
  recharts: 'window.SHADN.RECHARTS',
237
238
  'react-hook-form': 'window.SHADN.ReactHookForm',
238
239
  'lucide-react': 'window.SHADN.LUCIDE',
240
+ 'date-fns': 'window.SHADN.DateFns',
241
+ clsx: 'window.SHADN.CLSX',
242
+ 'tailwind-merge': 'window.SHADN.TailwindMerge',
239
243
  };
240
244
 
241
245
  if (/lowcode\//.test(context)) {
@@ -249,6 +253,25 @@ module.exports = function (options) {
249
253
  }
250
254
  callback();
251
255
  },
256
+ function (context, request, callback) {
257
+ if (/lowcode\//.test(context) && request === '@/lib/utils') {
258
+ const fs = require('fs');
259
+ // 构建要检查的文件路径:项目根目录下的lowcode/lib/utils
260
+ const filePath = path.join(context, 'src', 'lowcode', 'lib');
261
+ if (
262
+ hasUtils ||
263
+ fs.existsSync(path.join(filePath, 'utils.js')) ||
264
+ fs.existsSync(path.join(filePath, 'utils.ts'))
265
+ ) {
266
+ hasUtils = true;
267
+ callback();
268
+ } else {
269
+ callback(null, 'window.SHADN._LIB_UTILS');
270
+ }
271
+ } else {
272
+ callback();
273
+ }
274
+ },
252
275
  ],
253
276
  cache: {
254
277
  type: 'memory',