scalacenter / scalajs-bundler

https://scalacenter.github.io/scalajs-bundler
Other
237 stars 101 forks source link

Wrong entry in webpack config with BundlingMode.LibraryOnly() #323

Open joan38 opened 4 years ago

joan38 commented 4 years ago

Hi,

I tried to use fastOptJS / webpackBundlingMode := BundlingMode.LibraryOnly() and I can see the generated webpack config has one entry that is wrong to me:

...
  "entry": {
    "client-fastopt": ["/Users/jgoyeau/IdeaProjects/playback-tools/client/target/scala-2.12/scalajs-bundler/main/client-fastopt-entrypoint.js"]
  },
  "output": {
    "path": "/Users/jgoyeau/IdeaProjects/playback-tools/client/target/scala-2.12/scalajs-bundler/main",
    "filename": "[name]-library.js",
    "library": "ScalaJSBundlerLibrary",
    "libraryTarget": "var"
  },
...

Acording to this documentation: https://scalacenter.github.io/scalajs-bundler/reference.html#bundling-mode-library-only It should be:

...
  "entry": {
    "client-fastopt-library": ["/Users/jgoyeau/IdeaProjects/playback-tools/client/target/scala-2.12/scalajs-bundler/main/client-fastopt-library.js"],
    "client-fastopt-loader": ["/Users/jgoyeau/IdeaProjects/playback-tools/client/target/scala-2.12/scalajs-bundler/main/client-fastopt-loader.js"],
    "client-fastopt": ["/Users/jgoyeau/IdeaProjects/playback-tools/client/target/scala-2.12/scalajs-bundler/main/client-fastopt.js"]
  },
  "output": {
    "path": "/Users/jgoyeau/IdeaProjects/playback-tools/client/target/scala-2.12/scalajs-bundler/main",
    "filename": "[name].js"
  },
...

This is especially annoying when used with html-webpack-plugin as it generates the HTML page but adds the client-fastopt-entrypoint.js in the page.

Thanks