@octanejs/rspack-plugin 0.2.12 → 0.2.14
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/README.md +1 -1
- package/package.json +3 -3
- package/src/plugin.js +16 -1
package/README.md
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@octanejs/rspack-plugin",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.14",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"engines": {
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
},
|
|
46
46
|
"peerDependencies": {
|
|
47
47
|
"@rspack/core": "^2.0.0",
|
|
48
|
-
"octane": "^0.
|
|
48
|
+
"octane": "^0.22.0"
|
|
49
49
|
},
|
|
50
50
|
"devDependencies": {
|
|
51
51
|
"@rspack/core": "^2.1.4",
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
"@types/node": "^24.13.3",
|
|
54
54
|
"css-loader": "6.11.0",
|
|
55
55
|
"jsdom": "^30.0.1",
|
|
56
|
-
"octane": "0.
|
|
56
|
+
"octane": "0.22.0",
|
|
57
57
|
"vitest": "^4.1.10"
|
|
58
58
|
},
|
|
59
59
|
"scripts": {
|
package/src/plugin.js
CHANGED
|
@@ -114,6 +114,21 @@ function addRuntimeAliases(compiler, request, root, explicitRuntime, environment
|
|
|
114
114
|
const packageRoot = octanePackageRoot(override) ?? octanePackageRoot(selected) ?? root;
|
|
115
115
|
const aliases = esm.alias === false ? {} : (esm.alias ?? {});
|
|
116
116
|
const additions = {};
|
|
117
|
+
// An explicit runtime that selects the package's CommonJS build keeps the
|
|
118
|
+
// private entries compiled helpers import in that same module graph.
|
|
119
|
+
let subpathResolver = packageResolver;
|
|
120
|
+
if (
|
|
121
|
+
override !== undefined &&
|
|
122
|
+
override !== resolveRuntimeModule(packageResolver, 'octane', packageRoot)
|
|
123
|
+
) {
|
|
124
|
+
const commonjs = compiler.resolverFactory.get('normal', {
|
|
125
|
+
...compiler.webpack.util.cleverMerge(base, byDependency?.commonjs ?? {}),
|
|
126
|
+
alias: false,
|
|
127
|
+
dependencyType: 'commonjs',
|
|
128
|
+
});
|
|
129
|
+
if (resolveRuntimeModule(commonjs, 'octane', packageRoot) === override)
|
|
130
|
+
subpathResolver = commonjs;
|
|
131
|
+
}
|
|
117
132
|
for (const subpath of RUNTIME_SUBPATHS) {
|
|
118
133
|
// Resolve package self-references without a broad `octane` alias. Linked
|
|
119
134
|
// packages must share the selected runtime's refs, context, and profiler.
|
|
@@ -121,7 +136,7 @@ function addRuntimeAliases(compiler, request, root, explicitRuntime, environment
|
|
|
121
136
|
additions[`${subpath}$`] =
|
|
122
137
|
aliases[`${subpath}$`] ??
|
|
123
138
|
aliases[subpath] ??
|
|
124
|
-
resolveRuntimeModule(
|
|
139
|
+
resolveRuntimeModule(subpathResolver, subpath, packageRoot);
|
|
125
140
|
}
|
|
126
141
|
if (environment === 'server') {
|
|
127
142
|
const serverRequest = 'octane/react/server';
|