Merge pull request #18
* MP-19 Refactoring: Einführung der "Registry" & "Masterdata" Trennung … * MP-19 Refactoring: Frontend Tabula Rasa * MP-19 Refactoring: Frontend Tabula Rasa * refactoring: * MP-20 fix(docker/clients): include `:domains` module in web/desktop b… * MP-20 fix(web-app build): resolve JS compile error and add dev/prod b… * MP-20 fix(web-app): remove vendor.js reference and harden JS bootstra… * MP-20 fixing: clients * MP-20 fixing: clients
This commit is contained in:
@@ -3,49 +3,46 @@
|
||||
|
||||
// Bundle-Analyse für Development (optional, only if package is available)
|
||||
if (process.env.ANALYZE_BUNDLE === 'true') {
|
||||
try {
|
||||
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin;
|
||||
config.plugins.push(new BundleAnalyzerPlugin({
|
||||
analyzerMode: 'static',
|
||||
openAnalyzer: false,
|
||||
reportFilename: 'bundle-report.html'
|
||||
}));
|
||||
console.log('Bundle analyzer enabled');
|
||||
} catch (e) {
|
||||
console.log('Bundle analyzer not available (webpack-bundle-analyzer not installed)');
|
||||
}
|
||||
try {
|
||||
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin;
|
||||
config.plugins.push(new BundleAnalyzerPlugin({
|
||||
analyzerMode: 'static',
|
||||
openAnalyzer: false,
|
||||
reportFilename: 'bundle-report.html'
|
||||
}));
|
||||
console.log('Bundle analyzer enabled');
|
||||
} catch (e) {
|
||||
console.log('Bundle analyzer not available (webpack-bundle-analyzer not installed)');
|
||||
}
|
||||
}
|
||||
|
||||
// Weitere Optimierungen hinzufügen (erweitert bestehende config)
|
||||
config.optimization = {
|
||||
...config.optimization, // Behalte Kotlin/JS Optimierungen
|
||||
splitChunks: {
|
||||
chunks: 'all',
|
||||
cacheGroups: {
|
||||
vendor: {
|
||||
test: /[\\/]node_modules[\\/]/,
|
||||
name: 'vendor',
|
||||
chunks: 'all'
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
// Hinweis: Wir liefern eine statische index.html aus src/jsMain/resources aus.
|
||||
// Diese Datei enthält nur einen Script-Tag zu "web-app.js" und wird NICHT
|
||||
// vom HtmlWebpackPlugin generiert. Zusätzliche Chunks (z. B. vendor/runtime)
|
||||
// würden dann nicht automatisch injiziert und führen dazu, dass die App nicht startet
|
||||
// (Bildschirm bleibt auf "Loading...").
|
||||
//
|
||||
// Daher überschreiben wir config.optimization NICHT mehr mit splitChunks.
|
||||
// Wenn später Chunking gewünscht ist, muss die index.html durch die generierte
|
||||
// HTML ersetzt oder die zusätzlichen Chunks manuell eingebunden werden.
|
||||
//
|
||||
// (Frühere splitChunks-Konfiguration wurde bewusst entfernt.)
|
||||
|
||||
// Development Server Konfiguration erweitern
|
||||
if (config.devServer) {
|
||||
config.devServer = {
|
||||
...config.devServer,
|
||||
historyApiFallback: true,
|
||||
hot: true,
|
||||
// API Proxy für Backend-Anfragen (Array-Format für moderne Webpack)
|
||||
proxy: [
|
||||
{
|
||||
context: ['/api'],
|
||||
target: 'http://localhost:8081',
|
||||
changeOrigin: true,
|
||||
secure: false,
|
||||
pathRewrite: { '^/api': '' }
|
||||
}
|
||||
]
|
||||
}
|
||||
config.devServer = {
|
||||
...config.devServer,
|
||||
historyApiFallback: true,
|
||||
hot: true,
|
||||
// API Proxy für Backend-Anfragen (Array-Format für moderne Webpack)
|
||||
proxy: [
|
||||
{
|
||||
context: ['/api'],
|
||||
target: 'http://localhost:8081',
|
||||
changeOrigin: true,
|
||||
secure: false,
|
||||
pathRewrite: {'^/api': ''}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user