Add modern.config.ts with standalone/remote BUILD_TARGET branching
This commit is contained in:
@@ -0,0 +1,13 @@
|
|||||||
|
import { appTools, defineConfig } from "@modern-js/app-tools";
|
||||||
|
import { moduleFederationPlugin } from "@module-federation/modern-js";
|
||||||
|
|
||||||
|
const buildTarget = process.env["BUILD_TARGET"];
|
||||||
|
const isRemote = buildTarget === "remote";
|
||||||
|
|
||||||
|
export default defineConfig({
|
||||||
|
plugins: [appTools({ bundler: "rspack" }), moduleFederationPlugin()],
|
||||||
|
server: isRemote ? {} : { ssr: { mode: "stream" } },
|
||||||
|
output: {
|
||||||
|
distPath: { root: isRemote ? "dist/remote" : "dist/standalone" },
|
||||||
|
},
|
||||||
|
});
|
||||||
+1
-1
@@ -25,6 +25,6 @@
|
|||||||
},
|
},
|
||||||
"types": ["node", "vitest/globals"]
|
"types": ["node", "vitest/globals"]
|
||||||
},
|
},
|
||||||
"include": ["src/**/*.ts", "src/**/*.tsx", "vitest.config.ts"],
|
"include": ["src/**/*.ts", "src/**/*.tsx", "vitest.config.ts", "modern.config.ts", "module-federation.config.ts"],
|
||||||
"exclude": ["node_modules", "dist", "ClientApp", "wwwroot"]
|
"exclude": ["node_modules", "dist", "ClientApp", "wwwroot"]
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user