f61e050e8c
API functions now build the full localized path matching the Angular
EndpointService pattern (/api/flights/{version}/{locale}/{endpoint}).
The dev proxy forwards /api and /flights to the test backend.
35 lines
764 B
TypeScript
35 lines
764 B
TypeScript
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()],
|
|
source: {
|
|
entriesDir: "./src",
|
|
},
|
|
runtime: {
|
|
router: true,
|
|
},
|
|
dev: {
|
|
proxy: {
|
|
"/api": "https://flights.test.aeroflot.ru/api",
|
|
"/flights": "https://flights.test.aeroflot.ru/flights",
|
|
},
|
|
},
|
|
server: {
|
|
ssr: {
|
|
mode: "stream",
|
|
},
|
|
},
|
|
output: {
|
|
distPath: { root: isRemote ? "dist/remote" : "dist/standalone" },
|
|
},
|
|
tools: {
|
|
cssLoader: {
|
|
url: false,
|
|
},
|
|
},
|
|
});
|