@meteorjs/rspack 0.0.45 → 0.0.46

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.
@@ -252,6 +252,25 @@ export function cleanOmittedPaths(obj, options = {}) {
252
252
  return result;
253
253
  }
254
254
 
255
+ /**
256
+ * Normalizes externals configuration to ensure consistent handling.
257
+ * @param {Object} config - The configuration object
258
+ * @returns {Object} - The normalized configuration
259
+ */
260
+ function normalizeExternals(config) {
261
+ if (!config || !config.externals) return config;
262
+
263
+ // Create a deep clone of the config to avoid modifying the original
264
+ const result = { ...config };
265
+
266
+ // If externals is not an array, convert it to an array
267
+ if (!Array.isArray(result.externals)) {
268
+ result.externals = [result.externals];
269
+ }
270
+
271
+ return result;
272
+ }
273
+
255
274
  /**
256
275
  * Merges webpack/rspack configs with smart handling of overlapping rules.
257
276
  *
@@ -259,6 +278,9 @@ export function cleanOmittedPaths(obj, options = {}) {
259
278
  * @returns {Object} Merged config
260
279
  */
261
280
  export function mergeSplitOverlap(...configs) {
281
+ // Normalize externals in all configs before merging
282
+ const normalizedConfigs = configs.map(normalizeExternals);
283
+
262
284
  return mergeWithCustomize({
263
285
  customizeArray(a, b, key) {
264
286
  if (key === 'module.rules') {
@@ -287,5 +309,5 @@ export function mergeSplitOverlap(...configs) {
287
309
  // fall through to default merging
288
310
  return undefined;
289
311
  }
290
- })(...configs);
312
+ })(...normalizedConfigs);
291
313
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@meteorjs/rspack",
3
- "version": "0.0.45",
3
+ "version": "0.0.46",
4
4
  "description": "Configuration logic for using Rspack in Meteor projects",
5
5
  "main": "index.js",
6
6
  "type": "module",
package/rspack.config.js CHANGED
@@ -232,6 +232,7 @@ export default function (inMeteor = {}, argv = {}) {
232
232
  const externals = [
233
233
  /^meteor.*/,
234
234
  ...(isReactEnabled ? [/^react$/, /^react-dom$/] : []),
235
+ ...(isServer ? [/^bcrypt$/] : []),
235
236
  ];
236
237
  const alias = {
237
238
  '/': path.resolve(process.cwd()),