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:
parent
c1a597ffdc
commit
c331a94943
@ -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 {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user