Adds mix.inDevelopment() & mix.inTest() to Laravel Mix.
laravel-mix-environments is a simple plugin that extends laravel-mix with 2 additional methods.
mix.inDevelopment()returns true whenNODE_ENVis set todevelopment.mix.inTest()returns true whenNODE_ENVis set totest.
$ npm install laravel-mix-environmentsInside your webpack.mix.js file, import laravel-mix-environments after importing laravel-mix and start using them.
const mix = require('laravel-mix');
const mixEnvironments = require('laravel-mix-environments');
if (mix.inDevelopment()) {
// Add webpack configs for development environment here.
}
if (mix.inTest()) {
// Add webpack configs for test environment here.
}laravel-mix-environments by Yan Sern. This is an open source project released under the MIT License.
PS: I would love to know if you're using laravel-mix-environments. Tweet to me at @yansernio.