laravel-mix-environments
v0.1.2
Published
Adds mix.inDevelopment() & mix.inTest() to Laravel Mix.
Downloads
71
Maintainers
Readme
laravel-mix-environments
Adds mix.inDevelopment() & mix.inTest() to Laravel Mix.
Introduction
laravel-mix-environments is a simple plugin that extends laravel-mix with 2 additional methods.
mix.inDevelopment()
returns true whenNODE_ENV
is set todevelopment
.mix.inTest()
returns true whenNODE_ENV
is set totest
.
Installation
$ npm install laravel-mix-environments
Usage
Inside 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.
}
License
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.