javascript - Debugging in devtools with Webpack -


with require.js easy debug module in chrome's devtools, entering:

require('my-module').callthisfunction() 

with webpack not possible anymore, because compiles modules via cli , not export require.

window.webpackjsonp globally exposed, thought find module id , call this: webpackjsonp([1],[]), unfortunately returns undefined.

are there workarounds still able debug require.js?

add code module in bundle

require.ensure([], function() {   window.require = function(smth) {     return require('./' + smth);   }; }); 

now can use 'require' chrome console require('app').dosmth()


Comments

Popular posts from this blog

Magento/PHP - Get phones on all members in a customer group -

php - .htaccess mod_rewrite for dynamic url which has domain names -

Website Login Issue developed in magento -