Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@constgen/neutrino-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

@constgen/neutrino-mode

Neutrino middleware to automatically choose the building mode

  • 1.1.0
  • pnpm-temp
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1
Maintainers
1
Weekly downloads
 
Created
Source

@constgen/neutrino-mode

npm npm

Neutrino middleware to automatically choose the building mode (production or development) based on CLI command. It allows to pass less flags when run webpack or webpack-dev-server

Requirements

  • Node.js v10+
  • Neutrino v9

Installation

@constgen/neutrino-mode can be installed from NPM. You should install it to "dependencies" (--save) or "devDependncies" (--save-dev) depending on your goal.

npm install --save @constgen/neutrino-mode

Usage

Important: If you use this middleware, you should use it at the very beginning before any other middlewares as it correctly defines process.env.NODE_ENV and neutrino.config.mode()

These commands will enable development mode and watching. So it is recommended to use one of them in package.json scripts.start:

webpack-dev-server
webpack --mode development

All other commands will be production. So it is recommended to use one of them in package.json scripts.build:

webpack
webpack --mode production

In preset

Require this package and plug it into Neutrino. The middleware has no options:

let mode = require('@constgen/neutrino-mode')

neutrino.use(mode())

In neutrinorc

The middleware also may be used together with another presets in Neutrino rc-file, e.g.:

.neutrinorc.js

let mode = require('@constgen/neutrino-mode')

module.exports = {
   use: [
      mode()
   ]
}

Keywords

FAQs

Package last updated on 07 Apr 2020

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc