Laravel-mix: mix.inProduction is true when npm run dev

Created on 18 Jul 2017  路  3Comments  路  Source: JeffreyWay/laravel-mix

  • Laravel Mix Version: 1.0.7 (npm list --depth=0)
  • Node Version (node -v): 7.2.0
  • NPM Version (npm -v): 5.0.3
  • OS: OS X 10.11.6

Description:

When I run npm run dev mix.inProduction returns true.

Steps To Reproduce:

webpack.mix.js:

const { mix } = require('laravel-mix')

if (mix.inProduction) {
    console.log('WTF')
} else {
    console.log('not in production')
}

You'll see WTF logged in console, instead of 'not in production'.

Thank :)

Most helpful comment

So lame... closing issue.

mix.inProduction()

All 3 comments

So lame... closing issue.

mix.inProduction()

TypeError: mix.inProduction is not a function

if(process.env.NODE_ENV == 'development') { works for me instead.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

nezaboravi picture nezaboravi  路  3Comments

dtheb picture dtheb  路  3Comments

rderimay picture rderimay  路  3Comments

terion-name picture terion-name  路  3Comments

stefensuhat picture stefensuhat  路  3Comments