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
Post a Comment