@meteorjs/rspack 0.0.61 → 0.0.62

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/rspack.config.js +18 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@meteorjs/rspack",
3
- "version": "0.0.61",
3
+ "version": "0.0.62",
4
4
  "description": "Configuration logic for using Rspack in Meteor projects",
5
5
  "main": "index.js",
6
6
  "type": "commonjs",
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,18 @@ module.exports = async function (inMeteor = {}, argv = {}) {
660
666
  }
661
667
  }
662
668
 
663
- const config = isClient ? clientConfig : serverConfig;
669
+ // Establish Angular overrides to ensure proper integration
670
+ const angularExpandConfig = isAngularEnabled ? {
671
+ mode: isProd ? 'production' : 'development',
672
+ devServer: { port: Meteor.devServerPort },
673
+ stats: { preset: 'normal' },
674
+ infrastructureLogging: { level: 'info' },
675
+ } : {};
676
+
677
+ const config = mergeSplitOverlap(
678
+ isClient ? clientConfig : serverConfig,
679
+ angularExpandConfig
680
+ );
664
681
 
665
682
  if (Meteor.isDebug || Meteor.isVerbose) {
666
683
  console.log('Config:', inspect(config, { depth: null, colors: true }));