Now.sh build breaking due to: Support for the experimental syntax 'decorators-legacy' isn't currently enabled

前端 未结 3 598
别那么骄傲
别那么骄傲 2021-01-29 03:15

Expected:

After adding decko (Support for decorators) as well as adding support for experimetalDecoractors in my tsconfig.js

3条回答
  •  爱一瞬间的悲伤
    2021-01-29 03:31

    Just figured it out, I needed to add the plugin to the production part of my config for the build to work X_x

    {
      "env": {
        "development": {
          "presets": [
            "next/babel",
            "@zeit/next-typescript/babel"
          ],
          "plugins": [
            [
              "styled-components",
              {
                "ssr": true,
                "displayName": true
              }
            ],
            [
              "@babel/plugin-proposal-decorators",
              {
                "legacy": true
              }
            ]
          ]
        },
        "production": {
          "presets": [
            "next/babel",
            "@zeit/next-typescript/babel"
          ],
          "plugins": [
            [
              "styled-components",
              {
                "ssr": true,
                "displayName": true
              }
            ],
            [
              "@babel/plugin-proposal-decorators",
              {
                "legacy": true
              }
            ]
          ]
        },
    

提交回复
热议问题