scalacenter / scalajs-bundler

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

BundlingMode.LibraryOnly ignores `require` and `js.import` #414

Open cornerman opened 2 years ago

cornerman commented 2 years ago

I have an issue with ignored imports in BundlingMode.LibraryOnly.

When using the @JSImport("...") for everything, all is fine.

But this pattern of writing an annotated facade is a lot of boilerplate when requiring css files or one-off js depdencies. So, I would like to sometimes write this instead: js.`import`("...") or js.Dynamic.global.require("..."). Sadly, this only works in the default BundlingMode, but is not picked up in the entrypoints file from BundlingMode.LibraryOnly.