New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

webpack-mode

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

webpack-mode

Get current mode of Webpack 4 build

latest
Source
npmnpm
Version
1.1.0
Version published
Weekly downloads
220
6.8%
Maintainers
1
Weekly downloads
 
Created
Source

webpack-mode

Build Status

Get easily environment mode of Webpack build. Works only with Webpack 4.

Install

Simply run in terminal:

npm add --save-dev webpack-mode

or (if you use Yarn)

yarn add --dev webpack-mode

Usage

When you run webpack --mode=production or NODE_ENV=production webpack

// webpack.config.js
const { isProduction } = require("webpack-mode");

console.log(isProduction); // => true

// ... rest of the config

API

When you run webpack --mode=development

const webpackMode = require("webpack-mode");

webpackMode.isProduction; // false
webpackMode.isDevelopment; // true

webpackMode == "development"; // true
webpackMode === "development"; // false - webpackMode is not a string

console.log(`${webpackMode}`); // 'development'

Keywords

webpack

FAQs

Package last updated on 15 Jan 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts