Socket
Socket
Sign inDemoInstall

@constgen/neutrino-mode

Package Overview
Dependencies
297
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @constgen/neutrino-mode

Neutrino middleware to automatically choose the building mode


Version published
Weekly downloads
4
decreased by-20%
Maintainers
1
Install size
37.5 kB
Created
Weekly downloads
 

Readme

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
  • Webpack v4

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

Last updated on 28 Sep 2020

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc