diff --git a/packages/babel-plugin-transform-decorators/README.md b/packages/babel-plugin-transform-decorators/README.md index 69eaff6fbe..29f6fc8729 100644 --- a/packages/babel-plugin-transform-decorators/README.md +++ b/packages/babel-plugin-transform-decorators/README.md @@ -66,6 +66,8 @@ Add the following line to your .babelrc file: If you are including your plugins manually and using `transform-class-properties`, make sure that `transform-decorators` comes *before* `transform-class-properties`. +Currently, `transform-class-properties` must be used in `loose` mode to support the `transform-decorators`. To use `transform-class-properties` in spec mode with decorators, wait for the next major version of decorators (Stage 2). + Wrong: ```json @@ -83,7 +85,7 @@ Right: { "plugins": [ "transform-decorators", - "transform-class-properties" + ["transform-class-properties", { "loose" : true }] ] } ``` diff --git a/packages/babel-plugin-transform-decorators/src/index.js b/packages/babel-plugin-transform-decorators/src/index.js index 05d589b5aa..6f0455cad9 100644 --- a/packages/babel-plugin-transform-decorators/src/index.js +++ b/packages/babel-plugin-transform-decorators/src/index.js @@ -30,7 +30,9 @@ const buildInitializerWarningHelper = template(` function NAME(descriptor, context){ throw new Error( 'Decorating class property failed. Please ensure that ' + - 'transform-class-properties is enabled.' + 'transform-class-properties is enabled and set to use loose mode. ' + + 'To use transform-class-properties in spec mode with decorators, wait for ' + + 'the next major version of decorators in stage 2.' ); } `);