@alauda-fe/dynamic-plugin-sdk-rspack 0.0.1-alpha.1 → 0.0.1-alpha.3
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/index.js +20 -6
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -40,7 +40,7 @@ async function loadModule(path) {
|
|
|
40
40
|
return module.default || module;
|
|
41
41
|
}
|
|
42
42
|
var with_alauda_console_default = async (options) => {
|
|
43
|
-
const customWebpack = await loadModule("@alauda/custom-webpack");
|
|
43
|
+
const customWebpack = await loadModule("@alauda/custom-webpack/rspack");
|
|
44
44
|
return (config) => {
|
|
45
45
|
config.resolve ??= {};
|
|
46
46
|
config.resolve.alias ??= {};
|
|
@@ -129,11 +129,15 @@ function createRemoteProxy({ disableDevPluginProxy = false } = {}) {
|
|
|
129
129
|
return remoteProxy;
|
|
130
130
|
}
|
|
131
131
|
var with_host_mfe_config_default = async (mfeConfig, overrideConfig, options = {}) => {
|
|
132
|
-
const mfe = await withModuleFederation(mfeConfig,
|
|
133
|
-
|
|
132
|
+
const mfe = await withModuleFederation(mfeConfig, {
|
|
133
|
+
...overrideConfig,
|
|
134
|
+
dts: false
|
|
135
|
+
});
|
|
134
136
|
return (config) => merge2(mfe(config, { context: config.context }), {
|
|
135
137
|
devServer: {
|
|
136
|
-
proxy: createRemoteProxy({
|
|
138
|
+
proxy: createRemoteProxy({
|
|
139
|
+
disableDevPluginProxy: options.disableDevPluginProxy
|
|
140
|
+
})
|
|
137
141
|
}
|
|
138
142
|
});
|
|
139
143
|
};
|
|
@@ -171,10 +175,20 @@ var generateName = (name) => {
|
|
|
171
175
|
return `${name}__${commitID}`;
|
|
172
176
|
};
|
|
173
177
|
var with_remote_mfe_config_default = async (mfeConfig, overrideConfig) => {
|
|
174
|
-
const mfe = await withModuleFederation2(mfeConfig,
|
|
178
|
+
const mfe = await withModuleFederation2(mfeConfig, {
|
|
179
|
+
...overrideConfig,
|
|
180
|
+
dts: false,
|
|
181
|
+
// @ts-expect-error - The type definition of withModuleFederation is not accurate, it should allow filename to be string
|
|
182
|
+
filename: "remoteEntry.mjs",
|
|
183
|
+
library: {
|
|
184
|
+
type: "module"
|
|
185
|
+
}
|
|
186
|
+
});
|
|
175
187
|
return (config) => {
|
|
176
188
|
return merge4(mfe(config, { context: config.context }), {
|
|
177
|
-
output: {
|
|
189
|
+
output: {
|
|
190
|
+
uniqueName: generateName(mfeConfig.name)
|
|
191
|
+
},
|
|
178
192
|
devServer: {
|
|
179
193
|
headers: {
|
|
180
194
|
"Access-Control-Allow-Origin": "*"
|