Npm package.json Scripts Pass Environment Variable

February 20, 2020
  "scripts": {
    "dev": "env ENV_FILE=dev nuxt",
    "generate": "env BUILD_DIR=.nuxt-generate ENV_FILE=generate nuxt generate"
  },

NOTE: env only works with Mac/Linux. For cross platform support, use cross-env

This work is licensed under a
Creative Commons Attribution-NonCommercial 4.0 International License.