@meteorjs/rspack 0.0.61 → 0.0.63
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 +21 -1
package/package.json
CHANGED
package/rspack.config.js
CHANGED
|
@@ -95,6 +95,7 @@ function createSwcConfig({
|
|
|
95
95
|
externalHelpers,
|
|
96
96
|
isDevEnvironment,
|
|
97
97
|
isClient,
|
|
98
|
+
isAngularEnabled,
|
|
98
99
|
}) {
|
|
99
100
|
const defaultConfig = {
|
|
100
101
|
jsc: {
|
|
@@ -104,6 +105,7 @@ function createSwcConfig({
|
|
|
104
105
|
syntax: isTypescriptEnabled ? 'typescript' : 'ecmascript',
|
|
105
106
|
...(isTsxEnabled && { tsx: true }),
|
|
106
107
|
...(isJsxEnabled && { jsx: true }),
|
|
108
|
+
...(isAngularEnabled && { decorators: true }),
|
|
107
109
|
},
|
|
108
110
|
target: 'es2015',
|
|
109
111
|
...(isReactEnabled && {
|
|
@@ -228,6 +230,7 @@ module.exports = async function (inMeteor = {}, argv = {}) {
|
|
|
228
230
|
const isTsxEnabled =
|
|
229
231
|
Meteor.isTsxEnabled || (isTypescriptEnabled && isReactEnabled) || false;
|
|
230
232
|
const isBundleVisualizerEnabled = Meteor.isBundleVisualizerEnabled || false;
|
|
233
|
+
const isAngularEnabled = Meteor.isAngularEnabled || false;
|
|
231
234
|
|
|
232
235
|
// Determine entry points
|
|
233
236
|
const entryPath = Meteor.entryPath;
|
|
@@ -275,6 +278,7 @@ module.exports = async function (inMeteor = {}, argv = {}) {
|
|
|
275
278
|
enabled === 'memory' ? undefined : cacheStrategy
|
|
276
279
|
);
|
|
277
280
|
Meteor.splitVendorChunk = () => splitVendorChunk();
|
|
281
|
+
Meteor.createAngularConfig = () => createAngularConfig();
|
|
278
282
|
|
|
279
283
|
// Add HtmlRspackPlugin function to Meteor
|
|
280
284
|
Meteor.HtmlRspackPlugin = (options = {}) => {
|
|
@@ -335,6 +339,7 @@ module.exports = async function (inMeteor = {}, argv = {}) {
|
|
|
335
339
|
externalHelpers: enableSwcExternalHelpers,
|
|
336
340
|
isDevEnvironment,
|
|
337
341
|
isClient,
|
|
342
|
+
isAngularEnabled,
|
|
338
343
|
});
|
|
339
344
|
// Expose swc config to use in custom configs
|
|
340
345
|
Meteor.swcConfigOptions = swcConfigRule.options;
|
|
@@ -635,6 +640,7 @@ module.exports = async function (inMeteor = {}, argv = {}) {
|
|
|
635
640
|
: []),
|
|
636
641
|
].filter(Boolean);
|
|
637
642
|
const warningFn = path => {
|
|
643
|
+
if (isAngularEnabled) return;
|
|
638
644
|
console.warn(
|
|
639
645
|
`[rspack.config.js] Ignored custom "${path}" — reserved for Meteor-Rspack integration.`,
|
|
640
646
|
);
|
|
@@ -660,7 +666,21 @@ module.exports = async function (inMeteor = {}, argv = {}) {
|
|
|
660
666
|
}
|
|
661
667
|
}
|
|
662
668
|
|
|
663
|
-
|
|
669
|
+
// Establish Angular overrides to ensure proper integration
|
|
670
|
+
const angularExpandConfig = isAngularEnabled
|
|
671
|
+
? {
|
|
672
|
+
mode: isProd ? "production" : "development",
|
|
673
|
+
devServer: { port: Meteor.devServerPort },
|
|
674
|
+
stats: { preset: "normal" },
|
|
675
|
+
infrastructureLogging: { level: "info" },
|
|
676
|
+
...(isProd && isClient && { output: { module: false } }),
|
|
677
|
+
}
|
|
678
|
+
: {};
|
|
679
|
+
|
|
680
|
+
const config = mergeSplitOverlap(
|
|
681
|
+
isClient ? clientConfig : serverConfig,
|
|
682
|
+
angularExpandConfig
|
|
683
|
+
);
|
|
664
684
|
|
|
665
685
|
if (Meteor.isDebug || Meteor.isVerbose) {
|
|
666
686
|
console.log('Config:', inspect(config, { depth: null, colors: true }));
|