Building Vue app after upgrading to version 5 starts throw “Uncaught SyntaxError: Unexpected token ‘:'”

After upgrading @vue/cli-service to version ^5.0.4. the build command is not functioning normally as before. after building vue js for production, this was showing Uncaught SyntaxError: Unexpected token ':' in the console. After checking the code, The error was coming from

const Ee = () => `http://localhost:85/${Se()}`, Se = () => Ce() && we() ? 'api' : 'v1/api',
        Ce = () => 'DEVELOPMENT' === {
          NODE_ENV: 'production',
          VUE_APP_API_URL: 'http://localhost:85/',
          VUE_APP_URL: 'http://localhost:8080/',
          BASE_URL: "https://serveanswer.com/"
        }?.VUE_APP_ENVIRONMENT, we = () => {
          NODE_ENV:'production', VUE_APP_API_URL
        :
          'http://localhost:85/', VUE_APP_URL
        :
          'http://localhost:8080/', BASE_URL
        :
          "https://serveanswer.com/"
        }

I appreciate any help.

Read more here: Source link