@alauda-fe/dynamic-plugin-sdk-rspack 0.0.1-alpha.2 → 0.0.1-alpha.4

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