@meteorjs/rspack 0.0.37 → 0.0.39

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.
@@ -267,6 +267,14 @@ export function mergeSplitOverlap(...configs) {
267
267
  return splitOverlapRulesMerge(aRules, bRules);
268
268
  }
269
269
 
270
+ // Ensure custom extensions first
271
+ if (key === 'resolve.extensions') {
272
+ const aRules = Array.isArray(a) ? a : [];
273
+ const bRules = Array.isArray(b) ? b : [];
274
+ const merged = [...bRules, ...aRules];
275
+ return [...new Set(merged)];
276
+ }
277
+
270
278
  // Handle plugins uniqueness
271
279
  if (key === 'plugins') {
272
280
  return unique(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@meteorjs/rspack",
3
- "version": "0.0.37",
3
+ "version": "0.0.39",
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
@@ -118,7 +118,9 @@ export default function (inMeteor = {}, argv = {}) {
118
118
  const isDev = !!Meteor.isDevelopment || !isProd;
119
119
  const isTest = !!Meteor.isTest;
120
120
  const isClient = !!Meteor.isClient;
121
+ const isServer = !!Meteor.isServer;
121
122
  const isRun = !!Meteor.isRun;
123
+ const isBuild = !!Meteor.isBuild;
122
124
  const isReactEnabled = !!Meteor.isReactEnabled;
123
125
  const isTestModule = !!Meteor.isTestModule;
124
126
  const isTestEager = !!Meteor.isTestEager;
@@ -147,7 +149,7 @@ export default function (inMeteor = {}, argv = {}) {
147
149
  const runPath = Meteor.runPath;
148
150
 
149
151
  // Determine banner
150
- const bannerOutput = JSON.parse(Meteor.bannerOutput || process.env.RSPACK_BANNER || '');
152
+ const bannerOutput = JSON.parse(Meteor.bannerOutput || '');
151
153
 
152
154
  // Determine output directories
153
155
  const clientOutputDir = path.resolve(process.cwd(), 'public');
@@ -203,12 +205,13 @@ export default function (inMeteor = {}, argv = {}) {
203
205
  console.log('[i] Meteor flags:', Meteor);
204
206
  }
205
207
 
208
+ const enableSwcExternalHelpers = !isServer && swcExternalHelpers;
206
209
  const isDevEnvironment = isRun && isDev && !isTest && !isNative;
207
210
  const swcConfigRule = createSwcConfig({
208
211
  isTypescriptEnabled,
209
212
  isJsxEnabled,
210
213
  isTsxEnabled,
211
- externalHelpers: swcExternalHelpers,
214
+ externalHelpers: enableSwcExternalHelpers,
212
215
  isDevEnvironment,
213
216
  });
214
217
  // Expose swc config to use in custom configs
@@ -248,7 +251,7 @@ export default function (inMeteor = {}, argv = {}) {
248
251
  lastImports: [`./${outputFilename}`],
249
252
  }),
250
253
  }),
251
- enableGlobalPolyfill: isDevEnvironment,
254
+ enableGlobalPolyfill: isDevEnvironment && !isServer,
252
255
  });
253
256
 
254
257
  const rsdoctorModule = isBundleVisualizerEnabled
@@ -261,6 +264,14 @@ export default function (inMeteor = {}, argv = {}) {
261
264
  }),
262
265
  ]
263
266
  : [];
267
+ const bannerPluginConfig = !isBuild
268
+ ? [
269
+ new BannerPlugin({
270
+ banner: bannerOutput,
271
+ entryOnly: true,
272
+ }),
273
+ ]
274
+ : [];
264
275
 
265
276
  const clientNameConfig = `[${(isTest && 'test-') || ''}${
266
277
  (isTestModule && 'module') || 'client'
@@ -322,10 +333,7 @@ export default function (inMeteor = {}, argv = {}) {
322
333
  'Meteor.isDevelopment': JSON.stringify(isDev),
323
334
  'Meteor.isProduction': JSON.stringify(isProd),
324
335
  }),
325
- new BannerPlugin({
326
- banner: bannerOutput,
327
- entryOnly: true,
328
- }),
336
+ ...bannerPluginConfig,
329
337
  Meteor.HtmlRspackPlugin(),
330
338
  ...doctorPluginConfig,
331
339
  ],
@@ -404,11 +412,8 @@ export default function (inMeteor = {}, argv = {}) {
404
412
  'Meteor.isProduction': JSON.stringify(isProd),
405
413
  },
406
414
  ),
407
- new BannerPlugin({
408
- banner: bannerOutput,
409
- entryOnly: true,
410
- }),
411
- isTestModule && requireExternalsPlugin,
415
+ ...bannerPluginConfig,
416
+ requireExternalsPlugin,
412
417
  ...doctorPluginConfig,
413
418
  ],
414
419
  watchOptions,