laravel-mix-environments

0.1.2 • Public • Published

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 when NODE_ENV is set to development.
  • mix.inTest() returns true when NODE_ENV is set to test.

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.

Package Sidebar

Install

npm i laravel-mix-environments

Weekly Downloads

14

Version

0.1.2

License

MIT

Last publish

Collaborators

  • yansern