Laravel-mix: how to detect production in code to disable vue devtools

Created on 21 Apr 2017  路  4Comments  路  Source: JeffreyWay/laravel-mix

I'm using the latest version of laravel mix but i can't fin anywhere in the doc how to now in the js if we are in the production env or dev env. In webpack normally we have access to a process.env.NODE_ENV or something but here it doesn't seem to work, at least in dev mode

Most helpful comment

@riesjart i'm already loading the good vue file via

.webpackConfig({
        resolve: {
            alias: {
              'vue$': 'vue/dist/vue.runtime.js'
            }
        }
    })

All 4 comments

When you run npm run production, it'll automatically strip out the Vue warnings and such.

to be specific i still see the "vue" tab in my console on production

@darkylmnx Perhaps this can help you out: https://stackoverflow.com/a/41627264

@riesjart i'm already loading the good vue file via

.webpackConfig({
        resolve: {
            alias: {
              'vue$': 'vue/dist/vue.runtime.js'
            }
        }
    })
Was this page helpful?
0 / 5 - 0 ratings

Related issues

nezaboravi picture nezaboravi  路  3Comments

jpriceonline picture jpriceonline  路  3Comments

Bomavi picture Bomavi  路  3Comments

wendt88 picture wendt88  路  3Comments

pixieaka picture pixieaka  路  3Comments