fixing web-app
This commit is contained in:
@@ -106,6 +106,11 @@ kotlin {
|
||||
args.add("--mode=production")
|
||||
args.add("--optimization-minimize")
|
||||
}
|
||||
runTask {
|
||||
// Development optimizations for WASM
|
||||
args.add("--mode=development")
|
||||
// Dev server settings handled by webpack.config.d/dev-server.js
|
||||
}
|
||||
}
|
||||
|
||||
// WASM-specific compiler optimizations for smaller bundles
|
||||
|
||||
@@ -8,6 +8,10 @@
|
||||
</head>
|
||||
<body>
|
||||
<div id="ComposeTarget"></div>
|
||||
|
||||
<script type="application/javascript" src="meldestelle-wasm-vendors.js"></script>
|
||||
<script type="application/javascript" src="meldestelle-wasm-kotlin-stdlib.js"></script>
|
||||
<script type="application/javascript" src="meldestelle-wasm.js"></script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package at.mocode
|
||||
|
||||
actual object ApiConfig {
|
||||
actual val baseUrl: String = "" // Same-origin für Nginx-Proxy
|
||||
actual val baseUrl: String = "" // Same-origin für Nginx-Proxy
|
||||
actual val pingEndpoint: String = "/api/ping"
|
||||
}
|
||||
|
||||
@@ -8,6 +8,10 @@
|
||||
</head>
|
||||
<body>
|
||||
<canvas id="ComposeTarget"></canvas>
|
||||
|
||||
<script type="application/javascript" src="meldestelle-wasm-vendors.js"></script>
|
||||
<script type="application/javascript" src="meldestelle-wasm-kotlin-stdlib.js"></script>
|
||||
<script type="application/javascript" src="meldestelle-wasm.js"></script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -0,0 +1,47 @@
|
||||
// Development server configuration with API proxy
|
||||
// This forwards API requests from webpack-dev-server to the gateway
|
||||
|
||||
if (config.mode !== 'production') {
|
||||
config.devServer = {
|
||||
...config.devServer,
|
||||
|
||||
// Proxy API requests to the gateway - using modern object syntax
|
||||
proxy: {
|
||||
'/api/**': {
|
||||
target: 'http://localhost:8081',
|
||||
changeOrigin: true,
|
||||
secure: false,
|
||||
logLevel: 'debug',
|
||||
pathRewrite: {
|
||||
'^/api': '/api' // Keep the /api prefix for gateway routing
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
// Disable all caches as requested in previous issue
|
||||
headers: {
|
||||
'Cache-Control': 'no-cache, no-store, must-revalidate',
|
||||
'Pragma': 'no-cache',
|
||||
'Expires': '0'
|
||||
},
|
||||
|
||||
// Development middleware settings
|
||||
devMiddleware: {
|
||||
writeToDisk: false,
|
||||
stats: 'minimal'
|
||||
},
|
||||
|
||||
// Static files configuration
|
||||
static: {
|
||||
directory: 'src/commonMain/resources',
|
||||
serveIndex: true,
|
||||
watch: true
|
||||
},
|
||||
|
||||
// CORS settings for development
|
||||
allowedHosts: 'all',
|
||||
historyApiFallback: true,
|
||||
hot: true,
|
||||
liveReload: true
|
||||
};
|
||||
}
|
||||
@@ -57,8 +57,8 @@ config.optimization = {
|
||||
}
|
||||
},
|
||||
|
||||
// Minimize bundle size
|
||||
minimize: true
|
||||
// Minimize bundle size - conditional based on mode
|
||||
minimize: config.mode === 'production'
|
||||
// Note: minimizer is automatically configured by Kotlin/JS
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user