When running npm run dev it will not generate any sourcemaps.
But when you run the production build with npm run production there are sourcemaps generated.
Install Laravel latest
Install all dep. npm run install or yarn
Add sourceMaps() Function to the webpack.mix.js
mix.js('resources/assets/js/app.js', 'public/js')
.sass('resources/assets/sass/app.scss', `'public/css')`
.sourceMaps();
Run npm run dev (no sourcemaps)
then
run npm run production (sourcemaps)
OR
Run yarn run dev (no sourcemaps)
then
run yarn run production (sourcemaps)
No difference with yarn or npm
@christophwolff
when you run npm run dev, source maps are inline within your files.
You can disable your production source maps like this-
mix.sourceMaps(false);
@ankurk91 Thank you for clearing this up. I think @JeffreyWay can close this now.
@christophwolff
You can also close this issue, jeffreyWay is the busy person :)
Most helpful comment
@christophwolff
when you run
npm run dev, source maps are inline within your files.You can disable your production source maps like this-