@meteorjs/rspack 0.0.36 → 0.0.38
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/package.json +1 -1
- package/rspack.config.js +16 -11
package/package.json
CHANGED
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;
|
|
@@ -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:
|
|
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
|
-
|
|
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
|
-
|
|
408
|
-
|
|
409
|
-
entryOnly: true,
|
|
410
|
-
}),
|
|
411
|
-
isTestModule && requireExternalsPlugin,
|
|
415
|
+
...bannerPluginConfig,
|
|
416
|
+
requireExternalsPlugin,
|
|
412
417
|
...doctorPluginConfig,
|
|
413
418
|
],
|
|
414
419
|
watchOptions,
|