0

Related to: Webpack config not applied in kotlin multiplatform react project

As stated in the other Question this is a freshly created Full Stack Application from the IntelliJ Wizard.

I want to start the server/backend and the frontend separately. I had no issues with the server, but the some problems with the frontend. It doesn't seem to find the bundled js file when I start the task jsBrowserRun or jsBrowserDevelopmentRun I added a index.html and a webpack.config.js and of course I also tried it without the publicPath or historyApiFallback options.

I also looked at Webpack config: devServer.historyApiFallback and output.publicPath, but it didn't help me.

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="icon" href="/static/favicon.ico" type="image/x-icon">

    <title>Niblette</title>
    <script src="/Niblette-frontend.js"></script>
</head>
<body>
<div id="root"></div>
</body>
</html>
;(function(config) {
    config.mode = 'development'
    config.devServer.port = 8088
    config.devServer.historyApiFallback = true
    config.devServer.devMiddleware = {
        publicPath: '/'
    }
})(config);

Files

Browser

Output

Splitframe
  • 406
  • 3
  • 16

1 Answers1

0

After executing the jsBrowserDistribution task I noticed that the bundled js file was not named Niblette-frontend.js like it is called in the other build folders, but just Niblette.js. Changing this in the index.html did the trick.

Splitframe
  • 406
  • 3
  • 16