Phoenix + ReactJs and Webpack

My stack is Phoenix + ReactJS, and I’m having trouble with generating sourcemaps.
I can generate sourcemaps with webpack that is not an issue, I got generated app.js and, but when I run phx.digest I got different hash keys for files. For example:

Any ideas of how can overcome this issue?

Hi, as long as your JavaScript file points to //# sourceMappingURL=./app.js-[hash].map (should be at the end), the source map will load, even if it doesn’t have the same hash as the JavaScript file.

Remember to configure your web server to disallow access for normal users to the source map.

1 Like