Show a more informative error message when using the decorator transform and link to the legacy one [skip ci] (#3626)

This commit is contained in:
Henry Zhu 2016-08-02 20:47:03 -04:00 committed by GitHub
parent c1a597ffdc
commit c331a94943

View File

@ -71,7 +71,20 @@ export default function ({ types: t }) {
}
function doError(path) {
throw path.buildCodeFrameError("Decorators are not supported yet in 6.x pending proposal update.");
throw path.buildCodeFrameError(
`Decorators are not officially supported yet in 6.x pending a proposal update.
However, if you need to use them you can install the legacy decorators transform with:
npm install babel-plugin-transform-decorators-legacy --save-dev
and add the following line to your .babelrc file:
{
"plugins": ["transform-decorators-legacy"]
}
The repo url is: https://github.com/loganfsmyth/babel-plugin-transform-decorators-legacy.
`);
}
return {