Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sourcemap not work with BundlingMode.LibraryAndApplication #431

Open
doofin opened this issue Aug 1, 2022 · 0 comments
Open

sourcemap not work with BundlingMode.LibraryAndApplication #431

doofin opened this issue Aug 1, 2022 · 0 comments

Comments

@doofin
Copy link

doofin commented Aug 1, 2022

Hi it seems that sourcemap can't be generated with BundlingMode.LibraryAndApplication, js-fastopt-library.js.map

Fast optimizing /home/dg/work/scala-cross/js/target/scala-2.13/js-fastopt
[info] Bundling dependencies with source maps

[error] internal/fs/utils.js:332
[error] throw err;
[error] ^
[error] Error: ENOENT: no such file or directory, open '/home/dg/work/scala-cross/js/target/scala-2.13/scalajs-bundler/main/js-fastopt-library.js.map'
[error] at Object.openSync (fs.js:498:3)
[error] at Object.readFileSync (fs.js:394:35)
[error] at Object. (/home/dg/work/scala-cross/js/target/scala-2.13/scalajs-bundler/main/scalajsbundler-concat-js-fastopt-bundle.js:5:136)
[error] at Module._compile (internal/modules/cjs/loader.js:1085:14)
[error] at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
[error] at Module.load (internal/modules/cjs/loader.js:950:32)
[error] at Function.Module._load (internal/modules/cjs/loader.js:790:12)
[error] at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:75:12)
[error] at internal/main/run_main_module.js:17:47 {
[error] errno: -2,
[error] syscall: 'open',
[error] code: 'ENOENT',
[error] path: '/home/dg/work/scala-cross/js/target/scala-2.13/scalajs-bundler/main/js-fastopt-library.js.map'

relevant configs are:


      webpackBundlingMode := BundlingMode.LibraryAndApplication(),
      webpackEmitSourceMaps := true,
      scalaJSUseMainModuleInitializer := true,
      scalaJSLinkerConfig := StandardConfig()
//        .withSourceMap(false)
        .withSourceMap(true) // not work with LibraryAndApplication?
        .withModuleKind(
          ModuleKind.CommonJSModule
        ), //      https://github.com/scala-js/scala-js/issues/4305
      scalaJSLinkerConfig ~= { _.withESFeatures(_.withAvoidClasses(false)) },

scalajs-bundler versions : 0.21.0-RC1 0.20.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant