Closed rafaelkallis closed 7 years ago
Hi, @rafaelkallis! Thanks for reaching us out!
Here I created a testing repo: https://github.com/denysdovhan/babel-brunch-issue-52
I can confirm that behavior. Currently, I'm trying to figure out what's wrong with this. Stay in touch.
I was digging a bit in sources. I've found that this is, probably, related to order of plugins/presets — the common problem with Babel. Here are related items:
Unfortunately, changing of order of plugins not helping.
@denysdovhan first of all many thanks for the ongoing investigation. Allow me to share my "quick fix" for the current issue.
Using the following configuration, I get no errors:
// .babelrc
{
"presets": [
"latest",
"react"
],
"plugins": [
"transform-object-rest-spread",
"transform-class-properties",
"transform-decorators-legacy",
"transform-runtime"
]
}
// brunch-config.js (shortened)
exports.plugins = {
babel: {
plugins: [
"transform-decorators-legacy",
"transform-class-properties"
]
}
};
exports.files = { ... }
@rafaelkallis should be fixed in #53. Please, in package.json
try:
{
"babel-brunch": "denysdovhan/babel-brunch#fix-52-and-41"
}
Don't forget to remove your Babel settings from brunch-config.js
. Options from .babelrc
have to be loaded.
Works well for me: https://github.com/denysdovhan/babel-brunch-issue-52/commit/3c3111d2edb83249774dbe9c93cd2e5b673109b0
@denysdovhan I can confirm all transform-class-properties
errors while building are gone.
Unfortunately I'm getting runtime errors, but believe they are transform-decorator
related, thus independent from this issue. Since the decorator stuff is anyways highly experimental atm, I will drop decorators and continue business as usual.
Hope your fix gets in the master build soon. Thanks again! Issue can be closed IMO.
Issue can be closed IMO.
@rafaelkallis, let's keep this issue open until #53 will be merged.
@rafaelkallis #53 has been merged. Check version from master, until @paulmillr publish new version.
When specifying
transform-class-properties
inbrunch-config.js
like this:we get no errors, but when solely specifying in
.babelrc
and not in the brunch config, we get anMissing class properties transform
error. This does not happen with other transform-plugins, such astransform-decorators
ortransform-object-rest-spread
for example.Expected behaviour: No error
Actual behaviour:
Missing class properties transform
error.EDIT: Here's the error
brunch-config.js
:.babelrc
:npm
up-to-datenode
up-to-date dependencies up-to-date