Error: The 'decorators' plugin requires a 'decoratorsBeforeExport' option

Error:. The 'decorators' plugin requires a 'decoratorsBeforeExport' option, whose value must be a boolean If you are migrating from Babylon / Babel 6 or want to use the old decorators proposal, you should use the 'decorators-legacy' plugin instead of 'decorators' background: react project + babel 7 + error when used to decorate using the above decorator, install the appropriate plug-in and configure certain files, or may receive the following error solution steps are as follows: 1, install the following plug-ins npm install -D @ babel / plugin-proposal-decorators 1 2, .babelrc configuration file or files package.json babel field values ​​(both second election, not all configurations, whether the person will report to find two profiles wrong ) (1) configuration .babelrc file "plugins": [[ "@ babel / plugin-proposal-decorators", { "legacy": true}],] 1 2 3 (2) of the configuration file package.json field value babel babel: { "plugins": [[ "@ babel / plugin-proposal-decorators", { "legacy": true}],]} 1 2 3 4 5 reference article 'decorators-legacy' issue ------ --------------- author: D eng Winter Source: CSDN Original: https: //blog.csdn.

Guess you like

Origin www.cnblogs.com/renyunbo/p/11122821.html