Laravel-mix: Production command generates sourcemaps. Development not.

Created on 13 Jun 2017  路  3Comments  路  Source: JeffreyWay/laravel-mix

  • Laravel Mix Version: 0.12.1
  • Node Version: v8.1.0
  • NPM Version: 5.0.3
  • YARN Version: 0.24.5
  • OS: MacOS Sierra

Description:

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.

Steps To Reproduce:

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

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-

mix.sourceMaps(false);

All 3 comments

@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 :)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mstralka picture mstralka  路  3Comments

amin101 picture amin101  路  3Comments

pixieaka picture pixieaka  路  3Comments

nezaboravi picture nezaboravi  路  3Comments

terion-name picture terion-name  路  3Comments