Laravel-mix: Source Maps not generating in dev

Created on 26 Jun 2017  路  5Comments  路  Source: JeffreyWay/laravel-mix

  • Laravel Mix Version: #.#.# (npm list --depth=0) : version "1.0.6"
  • Node Version (node -v): 8.0.0
  • NPM Version (npm -v): 4.2.0
  • OS: osx 10.12.6

Description:

Source maps not getting generated

Steps To Reproduce:

const mix = require('laravel-mix')

/*
 |--------------------------------------------------------------------------
 | Mix Asset Management
 |--------------------------------------------------------------------------
 |
 | Mix provides a clean, fluent API for defining some Webpack build steps
 | for your Laravel application. By default, we are compiling the Sass
 | file for the application as well as bundling up all the JS files.
 |
 */

mix
    .js('resources/assets/js/app.js', 'public/js')
    .js('resources/assets/js/public.js', 'public/js')
    .sass('resources/assets/sass/app.scss', 'public/css')
    .sass('resources/assets/sass/public.scss', 'public/css')
    .extract([
        'vue',
        'vuex',
        'brace',
        'axios',
        'jquery',
        'lodash',
        'hint.css',
        'nprogress',
        'pusher-js',
        'clipboard',
        'vue-router',
        'vuedraggable',
        'laravel-echo',
        'moment-timezone',
        'filesize-parser',
        'lodash-inflection',
        'moment-precise-range-plugin'
    ])
    .autoload({
        vue: 'Vue',
        lodash: '_',
        ace: 'brace',
        'pusher-js': 'Pusher',
        clipboard: 'Clipboard',
        jquery: ['$', 'jQuery']
    })
    .sourceMaps()
    .version()

if (!mix.inProduction()) {
    mix.browserSync({
        open: 'external',
        host: 'codepier.dev',
        proxy: 'codepier.dev',
        files: [
            'resources/views/**/*.php',
            'public/js/**/*.js',
            'public/css/**/*.css'
        ]
    })
}

output :

npm run dev

image

Most helpful comment

Try this: https://github.com/JeffreyWay/laravel-mix/issues/879#issuecomment-310749504

Use one of them:
inline-source-map or source-map

All 5 comments

Try this: https://github.com/JeffreyWay/laravel-mix/issues/879#issuecomment-310749504

Use one of them:
inline-source-map or source-map

Hard to develop without scss source maps :/

Can confirm this issue. When using devtool: 'source-map', JS source maps are generated. .map files for CSS are generated but are blank.

Seems to be a duplicate of #879, so closing this one.

I find this solution:
https://github.com/JeffreyWay/laravel-mix/issues/1793#issuecomment-454948555

mix
    .sourceMaps(true, 'source-map') //this line
    .js('node_modules/bootstrap/dist/js/bootstrap.bundle.js', 'public/assets/bootstrap/js/bootstrap.js')
Was this page helpful?
0 / 5 - 0 ratings

Related issues

mementoneli picture mementoneli  路  3Comments

mstralka picture mstralka  路  3Comments

hasnatbabur picture hasnatbabur  路  3Comments

Bomavi picture Bomavi  路  3Comments

terion-name picture terion-name  路  3Comments