mhy
  • Introduction
  • Basics
    • Installation
    • Usage
    • UI
    • Ecosystem
    • How does it work?
  • Tools
    • Built-ins
      • boot
      • config
      • dep
      • options
      • ui
    • Processes
      • eslint
      • jest
      • node
      • nodemon
      • prettier
      • standard-version
      • storybook-start
      • storybook-build
      • tsc
      • webpack
      • webpack-bundle-analyzer
      • webpack-dev-server
    • Configs
      • eslint
      • gitignore
      • jest
      • manifest
      • mhy
      • npmignore
      • prettier
      • storybook
      • typescript
      • webpack
  • IDE setup
    • WebStorm & PHPStorm
    • VSCode
  • Recipes and Examples
    • package.json overrides
    • Add your own
  • Others
    • FAQ
    • Help
    • Development of mhy
    • Suggest a library
Powered by GitBook
On this page
  • --mhy-help
  • --mhy-debug
  • --mhy-verbose
  • --mhy-env
  • Basic Usage
  • Secondary environments
  • --mhy-if
  • --mhy-version

Was this helpful?

  1. Tools
  2. Built-ins

options

--mhy-help

# show usage details
mhy --mhy-help

--mhy-debug

# show debug messages
mhy --mhy-debug

--mhy-verbose

# show more info than usual
mhy --mhy-verbose

--mhy-env

Controls process.env.NODE_ENV variable and adds support to have multiple secondary environments.

Aliases:

  • prod: production

  • dev: development (default)

Basic Usage

# Run as NODE_ENV=production
mhy eslint --mhy-env=prod

# Run as NODE_ENV=production with secondary env called `ci`
mhy eslint --mhy-env=prod:ui

Secondary environments

You can use the : separator to define multiple secondary environments.

The first environment will be always set as a value for process.env.NODE_ENV.

Example

# Run webpack with configuration loaded for production mode, on Travis-CI only for the master branch.
mhy webpack --mhy-env=prod:travis:master

Secondary environments are supported and config also.

--mhy-if

Executes the command only when the given expression is truthy.

# On building master I don't need to run tests because they were validated before pull requests
mhy jest --mhy-if="!process.env.MHY_ENVS.includes('master')"

--mhy-version

# show mhy's currently installed version
mhy --mhy-version
PreviousdepNextui

Last updated 3 years ago

Was this helpful?