React debug in browser when using bundle.js

前端 未结 3 530
离开以前
离开以前 2021-01-31 18:37

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

3条回答
  •  执念已碎
    2021-01-31 19:19

    Its updated now you have to just include mode:"development" in top of module.exports and set a debugger in any where in your .js file it will work and open chrome devtools
    webpack.config.js:

    const path = require('path')
    module.exports = {
        mode: 'development',
    entry: path.join(__dirname,'src/js','index.js'),
      output: {
        path: path.join(__dirname, 'dist'),
          filename: 'build.js'
       },
      module: {}
    }
    

    check

提交回复
热议问题