How to disable bundling in Webpack for development?

此生再无相见时 提交于 2019-12-04 02:55:43

问题


In my web app I was using RequireJS to asynchronously load my javascript files on demand. This worked well for dev - when debugging my app I could see which script is dependent on which and order in which they were loaded. This simplified debugging.

Later I switched to Webpack as it is much easier in configuration and easier to maintain. So Webpack now generates for me nice bundles containing my javascript code. This works perfectly well but what I'd like to have is an imitation of my previous RequireJS configuration for dev time.

When I am developing my app I want Webpack to generate some simple entry point (just like in RequireJS) which would load my javascript files one by one through their "require" references. At the same time I still want that Webpack performed normal bundling when I deploy my app to a server.

Is this possible to achieve?


回答1:


Enable Devtools in webpack.config.js to control and generate source maps (Source Maps enhance debugging process).

webpack.config.js

  devtool: "#inline-source-map",

Chrome Debugger View




回答2:


Nope, that's not possible. But have you tried the devtool-option? It maps back your original files in your devtools so you should see no difference whether the modules were in different files or just all in one.



来源:https://stackoverflow.com/questions/38707267/how-to-disable-bundling-in-webpack-for-development

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!