How check if Vue is in development mode?

前端 未结 9 748
灰色年华
灰色年华 2021-01-03 18:14

When I run my Vue app, the console shows:

You are running Vue in development mode.
Make sure to turn on production mode when deploying for production.
See mo         


        
9条回答
  •  梦毁少年i
    2021-01-03 19:13

    Try using .env files.

    You can specify env variables by placing the following files in your project root:

    .env # loaded in all cases .env.local # loaded in all cases, ignored by git .env.[mode] # only loaded in specified mode .env.[mode].local # only loaded in specified mode, ignored by git

    plus

    Env Loading Priorities

    An env file for a specific mode (e.g. .env.production) will take higher priority than a generic one (e.g. .env).

    Docs: https://cli.vuejs.org/guide/mode-and-env.html#environment-variables

提交回复
热议问题