Merge branch 'modern-bundler-integration' into release-3.4

This commit is contained in:
Nacho Codoñer
2025-09-10 17:34:04 +02:00
19 changed files with 43 additions and 18 deletions

View File

@@ -252,6 +252,25 @@ export function cleanOmittedPaths(obj, options = {}) {
return result;
}
/**
* Normalizes externals configuration to ensure consistent handling.
* @param {Object} config - The configuration object
* @returns {Object} - The normalized configuration
*/
function normalizeExternals(config) {
if (!config || !config.externals) return config;
// Create a deep clone of the config to avoid modifying the original
const result = { ...config };
// If externals is not an array, convert it to an array
if (!Array.isArray(result.externals)) {
result.externals = [result.externals];
}
return result;
}
/**
* Merges webpack/rspack configs with smart handling of overlapping rules.
*
@@ -259,6 +278,9 @@ export function cleanOmittedPaths(obj, options = {}) {
* @returns {Object} Merged config
*/
export function mergeSplitOverlap(...configs) {
// Normalize externals in all configs before merging
const normalizedConfigs = configs.map(normalizeExternals);
return mergeWithCustomize({
customizeArray(a, b, key) {
if (key === 'module.rules') {
@@ -287,5 +309,5 @@ export function mergeSplitOverlap(...configs) {
// fall through to default merging
return undefined;
}
})(...configs);
})(...normalizedConfigs);
}

View File

@@ -1,12 +1,12 @@
{
"name": "@meteorjs/rspack",
"version": "0.0.44",
"version": "0.0.46",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "@meteorjs/rspack",
"version": "0.0.44",
"version": "0.0.46",
"license": "ISC",
"dependencies": {
"ignore-loader": "^0.1.2",

View File

@@ -1,6 +1,6 @@
{
"name": "@meteorjs/rspack",
"version": "0.0.44",
"version": "0.0.46",
"description": "Configuration logic for using Rspack in Meteor projects",
"main": "index.js",
"type": "module",

View File

@@ -217,7 +217,7 @@ export default function (inMeteor = {}, argv = {}) {
console.log('[i] Meteor flags:', Meteor);
}
const enableSwcExternalHelpers = !isServer && swcExternalHelpers;
const enableSwcExternalHelpers = !!swcExternalHelpers;
const isDevEnvironment = isRun && isDev && !isTest && !isNative;
const swcConfigRule = createSwcConfig({
isTypescriptEnabled,
@@ -232,6 +232,7 @@ export default function (inMeteor = {}, argv = {}) {
const externals = [
/^meteor.*/,
...(isReactEnabled ? [/^react$/, /^react-dom$/] : []),
...(isServer ? [/^bcrypt$/] : []),
];
const alias = {
'/': path.resolve(process.cwd()),

View File

@@ -367,7 +367,6 @@ if (Plugin?.rspackHelpers?.isRspackOutputFile(inputFilePath)) {
tsx: hasTSXSupport,
},
...(hasSwcHelpersAvailable &&
!isNodeTarget &&
(packageName == null ||
!['core-runtime', 'modules', 'modules-runtime'].includes(
packageName,

View File

@@ -5,7 +5,7 @@
export const DEFAULT_RSPACK_VERSION = '1.5.0';
export const DEFAULT_METEOR_RSPACK_VERSION = '0.0.44';
export const DEFAULT_METEOR_RSPACK_VERSION = '0.0.46';
export const DEFAULT_METEOR_RSPACK_REACT_HMR_VERSION = '1.4.3';

View File

@@ -11,6 +11,7 @@
"@babel/runtime": "^7.23.5",
"@modelcontextprotocol/sdk": "^1.17.3",
"@swc/helpers": "^0.5.17",
"bcrypt": "^6.0.0",
"meteor-node-stubs": "^1.2.12",
"react": "^18.3.1",
"react-compiler-runtime": "^19.1.0-rc.2",

View File

@@ -6,9 +6,11 @@ import '@helper/alias';
import ReactAlias from '@react/alias';
import './resolve-extensions/first';
import { TypescriptEnabled } from './ts/helpers';
import bcrypt from "bcrypt";
console.log('@react/alias loaded', ReactAlias.version);
console.log('TypescriptEnabled', TypescriptEnabled);
console.log("bcrypt loaded", !!bcrypt);
async function insertLink({ title, url }) {
await LinksCollection.insertAsync({ title, url, createdAt: new Date() });

View File

@@ -17,7 +17,7 @@
"vue-router": "^4.2.5"
},
"devDependencies": {
"@meteorjs/rspack": "^0.0.44",
"@meteorjs/rspack": "^0.0.46",
"@rspack/cli": "^1.4.8",
"@rspack/core": "^1.4.8",
"@tailwindcss/postcss": "^4.1.12",

View File

@@ -20,7 +20,7 @@
"devDependencies": {
"@graphql-tools/webpack-loader": "^7.0.0",
"@rsdoctor/rspack-plugin": "^1.2.3",
"@meteorjs/rspack": "^0.0.44",
"@meteorjs/rspack": "^0.0.46",
"@rspack/cli": "^1.5.0",
"@rspack/core": "^1.5.0",
"@rspack/plugin-react-refresh": "^1.4.3",

View File

@@ -14,7 +14,7 @@
"meteor-node-stubs": "^1.2.12"
},
"devDependencies": {
"@meteorjs/rspack": "^0.0.44",
"@meteorjs/rspack": "^0.0.46",
"@rsdoctor/rspack-plugin": "^1.2.3",
"@rspack/cli": "^1.5.0",
"@rspack/core": "^1.5.0",

View File

@@ -21,7 +21,7 @@
"react-dom": "^18.2.0"
},
"devDependencies": {
"@meteorjs/rspack": "^0.0.44",
"@meteorjs/rspack": "^0.0.46",
"@rsdoctor/rspack-plugin": "^1.2.3",
"@rspack/cli": "^1.5.0",
"@rspack/core": "^1.5.0",

View File

@@ -12,7 +12,7 @@
"meteor-node-stubs": "^1.2.12"
},
"devDependencies": {
"@meteorjs/rspack": "^0.0.44",
"@meteorjs/rspack": "^0.0.46",
"@rsdoctor/rspack-plugin": "^1.2.3",
"@rspack/cli": "^1.5.0",
"@rspack/core": "^1.5.0",

View File

@@ -15,7 +15,7 @@
"react-dom": "^18.2.0"
},
"devDependencies": {
"@meteorjs/rspack": "^0.0.44",
"@meteorjs/rspack": "^0.0.46",
"@rsdoctor/rspack-plugin": "^1.2.3",
"@rspack/cli": "^1.5.0",
"@rspack/core": "^1.5.0",

View File

@@ -14,7 +14,7 @@
"picocolors": "^1.1.1"
},
"devDependencies": {
"@meteorjs/rspack": "^0.0.44",
"@meteorjs/rspack": "^0.0.46",
"@rsdoctor/rspack-plugin": "^1.2.3",
"@rspack/cli": "^1.5.0",
"@rspack/core": "^1.5.0",

View File

@@ -13,7 +13,7 @@
"meteor-node-stubs": "^1.2.12"
},
"devDependencies": {
"@meteorjs/rspack": "^0.0.44",
"@meteorjs/rspack": "^0.0.46",
"@rsdoctor/rspack-plugin": "^1.2.3",
"@rspack/cli": "^1.5.0",
"@rspack/core": "^1.5.0",

View File

@@ -16,7 +16,7 @@
"react-dom": "^17.0.2"
},
"devDependencies": {
"@meteorjs/rspack": "^0.0.44",
"@meteorjs/rspack": "^0.0.46",
"@rsdoctor/rspack-plugin": "^1.2.3",
"@rspack/cli": "^1.5.0",
"@rspack/core": "^1.5.0",

View File

@@ -15,7 +15,7 @@
"react-dom": "^18.2.0"
},
"devDependencies": {
"@meteorjs/rspack": "^0.0.44",
"@meteorjs/rspack": "^0.0.46",
"@rsdoctor/rspack-plugin": "^1.2.3",
"@rspack/cli": "^1.5.0",
"@rspack/core": "^1.5.0",

View File

@@ -17,7 +17,7 @@
"vue-router": "^4.2.5"
},
"devDependencies": {
"@meteorjs/rspack": "^0.0.44",
"@meteorjs/rspack": "^0.0.46",
"@rsdoctor/rspack-plugin": "^1.2.3",
"@rspack/cli": "^1.5.0",
"@rspack/core": "^1.5.0",