Monday, June 3, 2024
 Popular · Latest · Hot · Upcoming
72
rated 0 times [  75] [ 3]  / answers: 1 / hits: 28035  / 9 Years ago, mon, september 28, 2015, 12:00:00

Tools: Chrome Developer Tools, ReactJs and Webpack



Maybe it was when I switched to bundling with webpack, but initially when I started my project I was able to bundle my js into a bundle.js file but still have access to the files in the browser debugging tool. Now all I see in the browser in my js folder is bundle.js



Using webpack how do I get back to being able to see all my Javascript files in the browser debugger so I can do stuff like insert breakpoints?


More From » debugging

 Answers
24

After a long time of pointlessly using a bunch of print statements I finally went back and figured out how to do this.



Here is how you get your ability to use breakpoints again after you bundle:



1)



Go to your webpack.config.js file and set devtools from true to source-map or one of the other options that @MichelleTilley explained in her answer.



webpack.config.js(here is an example)



module.exports = {
entry: ./js/app.js,
output: {
filename: js/bundle.js
},
debug: true,
devtool: #eval-source-map,
module: {
loaders: [
{
test: /.jsx?$/,
exclude: /(node_modules|bower_components)/,
loader: 'babel'
}
]
}
};


2)



Also like @MichelleTilley explained in her answer you may need to enable the devtools options in the Chrome.



3)



After this the when you go to debug you will have to look for a new folder just named . that is super hard to notice!



Thanks to the Stackoverflow answer below with the posted images I finally found where that folder was.



Configure webpack to allow browser debugging


[#64912] Thursday, September 24, 2015, 9 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
nadiatristinl

Total Points: 151
Total Questions: 116
Total Answers: 108

Location: Japan
Member since Tue, Jul 26, 2022
2 Years ago
nadiatristinl questions
Tue, Mar 15, 22, 00:00, 2 Years ago
Wed, Dec 29, 21, 00:00, 2 Years ago
Thu, Dec 17, 20, 00:00, 4 Years ago
Sat, Jul 11, 20, 00:00, 4 Years ago
Wed, Apr 29, 20, 00:00, 4 Years ago
;