Vue-cli3 environment mode and variable undefine

defines a schema for proxy. The contents of .env.proxy.loacl are as follows,

NODE_ENV=development
VUE_APP_PROXY=proxy

execute command: vue-cli-service serve-- model proxy,
process.env.VUE_APP_PROXY cannot be accessed in vue.config.js

chainWebpack: config  => {
        //prefetchpreload    
        config.plugins.delete("prefetch");
        config.plugins.delete("preload");
        // config.plugins.delete("uglifyjs");
        if(process.env.NODE_ENV){
            console.log(process.env.VUE_APP_PROXY)
        }
        
        (process.env.NODE_ENV === "development") && (process.env.VUE_APP_PROXY === "proxy") && config.devServer.proxy({
                "/*.action":{
                    target: "http://localhost:8080",
                    changeOrigin: true,
                    secure: false
            
        }});
            
        
    },

the specific code is posted and what are you doing?


can you see if you can access it in your vue code

I tried it myself. It's accessible

.

dizzy to death is really a command problem. My command is typed incorrectly. It is-- mode, is not-- model,vue-cli-serve does not have this parameter

.
Menu