Skip to content

transform-class-properties in .babelrc results in error #52

@rafaelkallis

Description

@rafaelkallis

When specifying transform-class-properties in brunch-config.js like this:

plugins: {
    babel: {
        plugins: ["transform-class-properties"]
    }
}

we get no errors, but when solely specifying in .babelrc and not in the brunch config, we get an Missing class properties transform error. This does not happen with other transform-plugins, such as transform-decorators or transform-object-rest-spread for example.


Expected behaviour: No error

Actual behaviour: Missing class properties transform error.

EDIT: Here's the error

01:40:02 - error: Compiling of app/test.js failed. L6:4 Missing class properties transform.
     4 | 
     5 | class Foo {
   > 6 |     static bar = 'bar';
       |     ^
     7 | }

brunch-config.js:

exports.files = {
    javascripts: {
        entryPoints: { 'app/initialize.js': 'app.js' }
    },
    stylesheets: {joinTo: 'app.css'}
};

exports.modules = {
    autoRequire: {'app.js': ['initialize']}
};

.babelrc:

{
  "presets": [
    "latest",
    "react"
  ],
  "plugins": [
    "transform-class-properties",
    "transform-decorators",
    "transform-object-rest-spread"
  ]
}

npm up-to-date
node up-to-date
dependencies up-to-date

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions