@meteorjs/rspack 0.0.5 → 0.0.6
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 +11 -7
package/package.json
CHANGED
package/rspack.config.js
CHANGED
|
@@ -3,6 +3,7 @@ import fs from 'fs';
|
|
|
3
3
|
import { createRequire } from 'module';
|
|
4
4
|
import path from 'path';
|
|
5
5
|
import { merge } from 'webpack-merge';
|
|
6
|
+
import { inspect } from "node:util";
|
|
6
7
|
|
|
7
8
|
import { RequireExternalsPlugin } from './plugins/RequireExtenalsPlugin.js';
|
|
8
9
|
import { getMeteorAppSwcConfig } from "./lib/swc.js";
|
|
@@ -182,6 +183,8 @@ export default function (inMeteor = {}, argv = {}) {
|
|
|
182
183
|
: []),
|
|
183
184
|
];
|
|
184
185
|
|
|
186
|
+
const reactRefreshModule = isReactEnabled ? safeRequire('@rspack/plugin-react-refresh') : null;
|
|
187
|
+
|
|
185
188
|
// Base client config
|
|
186
189
|
let clientConfig = {
|
|
187
190
|
name: 'meteor-client',
|
|
@@ -220,8 +223,8 @@ export default function (inMeteor = {}, argv = {}) {
|
|
|
220
223
|
plugins: [
|
|
221
224
|
...(isRun
|
|
222
225
|
? [
|
|
223
|
-
...(isReactEnabled
|
|
224
|
-
? [new (
|
|
226
|
+
...(isReactEnabled && reactRefreshModule
|
|
227
|
+
? [new reactRefreshModule()]
|
|
225
228
|
: []),
|
|
226
229
|
new RequireExternalsPlugin({
|
|
227
230
|
filePath: path.join(buildContext, runPath),
|
|
@@ -334,10 +337,11 @@ export default function (inMeteor = {}, argv = {}) {
|
|
|
334
337
|
}
|
|
335
338
|
}
|
|
336
339
|
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
+
const config = isClient ? clientConfig : serverConfig;
|
|
341
|
+
|
|
342
|
+
if (Meteor.isDebug) {
|
|
343
|
+
console.log('Config:', inspect(config, { depth: null, colors: true }));
|
|
340
344
|
}
|
|
341
|
-
|
|
342
|
-
return [
|
|
345
|
+
|
|
346
|
+
return [config];
|
|
343
347
|
}
|