@openmrs/rspack-config 9.0.3-pre.4421 → 9.0.3-pre.4422
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/dist/index.js +10 -2
- package/package.json +1 -1
- package/src/index.ts +9 -0
package/dist/index.js
CHANGED
|
@@ -168,6 +168,8 @@ exports.default = (env, argv = {}) => {
|
|
|
168
168
|
const { name, version, peerDependencies, browser, main, types } = require((0, path_1.resolve)(root, 'package.json'));
|
|
169
169
|
// this typing is provably incorrect, but actually works
|
|
170
170
|
const mode = (argv.mode || process.env.NODE_ENV || 'development');
|
|
171
|
+
const devServerPort = argv.port ? Number(argv.port) : undefined;
|
|
172
|
+
const devServerHost = argv.host || 'localhost';
|
|
171
173
|
const filename = (0, path_1.basename)(browser || main);
|
|
172
174
|
const outDir = (0, path_1.dirname)(browser || main);
|
|
173
175
|
const srcFile = (0, path_1.resolve)(root, browser ? main : types);
|
|
@@ -189,7 +191,7 @@ exports.default = (env, argv = {}) => {
|
|
|
189
191
|
},
|
|
190
192
|
},
|
|
191
193
|
};
|
|
192
|
-
const baseConfig = Object.assign({
|
|
194
|
+
const baseConfig = Object.assign(Object.assign({
|
|
193
195
|
// The only `entry` in the application is the app shell. Everything else is
|
|
194
196
|
// a Webpack Module Federation "remote." This ensures that there is always
|
|
195
197
|
// only one container context--i.e., if we had an entry point per module,
|
|
@@ -334,6 +336,12 @@ exports.default = (env, argv = {}) => {
|
|
|
334
336
|
'lodash.omit': 'lodash-es/omit',
|
|
335
337
|
'lodash.throttle': 'lodash-es/throttle',
|
|
336
338
|
},
|
|
337
|
-
} },
|
|
339
|
+
} }, (devServerPort !== undefined && {
|
|
340
|
+
lazyCompilation: {
|
|
341
|
+
imports: true,
|
|
342
|
+
entries: false,
|
|
343
|
+
serverUrl: `http://${devServerHost}:${devServerPort}`,
|
|
344
|
+
},
|
|
345
|
+
})), exports.overrides);
|
|
338
346
|
return (0, lodash_1.mergeWith)(baseConfig, exports.additionalConfig, mergeFunction);
|
|
339
347
|
};
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -157,6 +157,8 @@ export default (env: Record<string, string>, argv: Record<string, string> = {})
|
|
|
157
157
|
const { name, version, peerDependencies, browser, main, types } = require(resolve(root, 'package.json'));
|
|
158
158
|
// this typing is provably incorrect, but actually works
|
|
159
159
|
const mode = (argv.mode || process.env.NODE_ENV || 'development') as OpenmrsRspackConfig['mode'];
|
|
160
|
+
const devServerPort = argv.port ? Number(argv.port) : undefined;
|
|
161
|
+
const devServerHost = argv.host || 'localhost';
|
|
160
162
|
const filename = basename(browser || main);
|
|
161
163
|
const outDir = dirname(browser || main);
|
|
162
164
|
const srcFile = resolve(root, browser ? main : types);
|
|
@@ -358,6 +360,13 @@ export default (env: Record<string, string>, argv: Record<string, string> = {})
|
|
|
358
360
|
'lodash.throttle': 'lodash-es/throttle',
|
|
359
361
|
},
|
|
360
362
|
},
|
|
363
|
+
...(devServerPort !== undefined && {
|
|
364
|
+
lazyCompilation: {
|
|
365
|
+
imports: true,
|
|
366
|
+
entries: false,
|
|
367
|
+
serverUrl: `http://${devServerHost}:${devServerPort}`,
|
|
368
|
+
},
|
|
369
|
+
}),
|
|
361
370
|
...overrides,
|
|
362
371
|
};
|
|
363
372
|
return mergeWith(baseConfig, additionalConfig, mergeFunction);
|