ptech-preset 1.2.1 → 1.2.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.
- package/dist/index.js +4 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -174,7 +174,6 @@ function pluginCore(opts) {
|
|
|
174
174
|
}
|
|
175
175
|
return {
|
|
176
176
|
name: "plugin-mf-auto",
|
|
177
|
-
apply: "build",
|
|
178
177
|
async setup(api) {
|
|
179
178
|
const { pluginModuleFederation } = await import("@module-federation/rsbuild-plugin");
|
|
180
179
|
const getExposes = async () => {
|
|
@@ -250,7 +249,10 @@ function pluginCore(opts) {
|
|
|
250
249
|
mfMerged.exposes = { ...mfMerged.exposes ?? {}, [stylesExposeKey]: `./${relFromRoot}` };
|
|
251
250
|
}
|
|
252
251
|
}
|
|
253
|
-
|
|
252
|
+
const isBuild = api?.context?.command === "build" || process.env.NODE_ENV === "production";
|
|
253
|
+
if (typeof mfMerged.dts === "undefined") {
|
|
254
|
+
mfMerged.dts = isBuild;
|
|
255
|
+
}
|
|
254
256
|
const mfPlugin = pluginModuleFederation(mfMerged);
|
|
255
257
|
await mfPlugin.setup?.(api);
|
|
256
258
|
const pkgSafe = getPackageName(root) || mfMerged.name || path3.basename(root).replace(/\W+/g, "");
|