1 thought on “Unexpected token punc «:», expected punc «,»

  1. @akprgm , @Code2Life , suppose you have definition like process.env.API_URL === "http://abc.com", you should

    plugins: [
        new webpack.DefinePlugin({
          CONFIG: {
    -        API_URL: process.env.API_URL,
    +        API_URL: JSON.stringify(process.env.API_URL),
          },
        }),
    ]

    Or you will get code like

    (function(){
      console.log(Object({"API_URL":http://abc.com}));
    }());

    Which is surely wrong.

Comments are closed.