@meteorjs/rspack 0.0.54 → 0.0.56
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 +12 -6
package/package.json
CHANGED
package/rspack.config.js
CHANGED
|
@@ -46,10 +46,12 @@ function createCacheStrategy(mode, side) {
|
|
|
46
46
|
// SWC loader rule (JSX/JS)
|
|
47
47
|
function createSwcConfig({
|
|
48
48
|
isTypescriptEnabled,
|
|
49
|
+
isReactEnabled,
|
|
49
50
|
isJsxEnabled,
|
|
50
51
|
isTsxEnabled,
|
|
51
52
|
externalHelpers,
|
|
52
53
|
isDevEnvironment,
|
|
54
|
+
isClient,
|
|
53
55
|
}) {
|
|
54
56
|
const defaultConfig = {
|
|
55
57
|
jsc: {
|
|
@@ -61,12 +63,14 @@ function createSwcConfig({
|
|
|
61
63
|
...(isJsxEnabled && { jsx: true }),
|
|
62
64
|
},
|
|
63
65
|
target: 'es2015',
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
66
|
+
...(isReactEnabled && {
|
|
67
|
+
transform: {
|
|
68
|
+
react: {
|
|
69
|
+
development: isDevEnvironment,
|
|
70
|
+
...(isClient && { refresh: isDevEnvironment }),
|
|
71
|
+
},
|
|
68
72
|
},
|
|
69
|
-
},
|
|
73
|
+
}),
|
|
70
74
|
externalHelpers,
|
|
71
75
|
},
|
|
72
76
|
};
|
|
@@ -225,10 +229,12 @@ module.exports = async function (inMeteor = {}, argv = {}) {
|
|
|
225
229
|
const isDevEnvironment = isRun && isDev && !isTest && !isNative;
|
|
226
230
|
const swcConfigRule = createSwcConfig({
|
|
227
231
|
isTypescriptEnabled,
|
|
232
|
+
isReactEnabled,
|
|
228
233
|
isJsxEnabled,
|
|
229
234
|
isTsxEnabled,
|
|
230
235
|
externalHelpers: enableSwcExternalHelpers,
|
|
231
236
|
isDevEnvironment,
|
|
237
|
+
isClient,
|
|
232
238
|
});
|
|
233
239
|
// Expose swc config to use in custom configs
|
|
234
240
|
Meteor.swcConfigOptions = swcConfigRule.options;
|
|
@@ -274,7 +280,7 @@ module.exports = async function (inMeteor = {}, argv = {}) {
|
|
|
274
280
|
const rsdoctorModule = isBundleVisualizerEnabled
|
|
275
281
|
? safeRequire('@rsdoctor/rspack-plugin')
|
|
276
282
|
: null;
|
|
277
|
-
const doctorPluginConfig = isBundleVisualizerEnabled && rsdoctorModule?.RsdoctorRspackPlugin
|
|
283
|
+
const doctorPluginConfig = isRun && isBundleVisualizerEnabled && rsdoctorModule?.RsdoctorRspackPlugin
|
|
278
284
|
? [
|
|
279
285
|
new rsdoctorModule.RsdoctorRspackPlugin({
|
|
280
286
|
port: isClient
|