0
votes

I'm migrating a web app from requireJS to webpack. With requireJS, I have different configurations depending on the environment.

  • For live environment I use r.js to minify and bundle all of my modules and their dependencies into a single file. Afterwards, I add almondJS to manage the dependencies and then I load my js bundle like the following:

    <script src="bundle.min.js"></script> 
    
  • For my development environment, I Load requireJS like this:

    <script src="require.js" data-main="/main-config"></script> 
    

    and requireJS will use my configuration file specified by data-main, to load modules and their dependencies asynchronously

As you can see, with requireJS module loading and bundling are two separate processes and that allows me to debug AMD modules during development without needing sourcemaps

How can I achieve this scenario using webpack as a module loader only without bundling during development ?

If this is not possible, is there any other way I can see my source files in the browser debugger without generating sourcemaps?

1

1 Answers

1
votes

How can I achieve this scenario using webpack as a module loader only without bundling during development ?

Webpack will always bundle, despite the envieronment.

If this is not possible, is there any other way I can see my source files in the browser debugger without generating sourcemaps?

If your code is transpiled/compiled, you'll need sourcemaps to see that. There is no way to workaround that.