• Resolved eduwass

    (@eduwass)


    context: building a plugin using wordpress/scripts build process, the errors in console.log point to compiled files, making it a bit hard to debug things

    picture 1: you can see how console logs take me to compiled js
    picture 2: the compiled js file (note that at the end of the compiled js file it contains //# sourceMappingURL=index.js.map )
    picture 3: if going to the bottom of sources in devtools I can see the actual sourcemaps, shouldn’t the console.logs take me directly here instead of me having to trace this down?) 

    is this expected or am I doing something wrong? 😅 any guidance appreciated

    • This topic was modified 2 years, 8 months ago by eduwass.
    • This topic was modified 2 years, 8 months ago by Jan Dembowski.
Viewing 2 replies - 1 through 2 (of 2 total)
  • First, it is easier to develop if you use START rather than BUILD.

    As I haven’t generally debugged in BUILD mode I can’t say for sure, but what browser dev tools to you use ( Chrome? ) I use Firefox Develoer Edition which I find easier to navigate the dev tool sets.

    Thread Starter eduwass

    (@eduwass)

    In the end I was able to fix it by turning off minification in webpack.config.js, e.g:

      config.optimization = {
        ...defaultConfig.optimization,
        runtimeChunk: "single",
        minimize: false
      };
    • This reply was modified 2 years, 8 months ago by eduwass.
Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Sourcemaps when developing?’ is closed to new replies.