New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(babel): loose option for babel class-properties and private-methods #9232
Conversation
Trying this in <script>
class TestClass {
// Property initializer syntax
instanceProperty = 'test';
boundFunction = () => {
return this.instanceProperty
};
// Static class properties
static staticProperty = 'babelIsCool';
static staticFunction = function () {
return TestClass.staticProperty
};
}
console.log(new TestClass().instanceProperty )
export default {
head: {
title: 'Home page'
}
}
</script> Throws a build error (only for server):
|
What’s your node version? |
I don't think it's a depepdency issue, I think it because your node verison supports class property, so babel won't transpile it, but webpack (old acorn) doesn't support it, I'll have a look |
1fb30e7
to
d20a3a3
Compare
@pi0 Updated, can you please double check and give me a review ? |
Oops, pr title is not updated. I’ll try to amend it |
Take a look at the following article https://www.linkedin.com/pulse/nuxtjs-warn-though-loose-option-set-false-your-babelpreset-env-/ |
Types of changes
Description
Fix #9224
@babel/plugin-proposal-class-properties can be removed now as it has been included in @babel/preset-env
Checklist: