-
Notifications
You must be signed in to change notification settings - Fork 1
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
export default class ... breaks transpiler #24
Comments
export default MyClass
breaks transpiler
Thank you for your feedback I usually use dedicated lines for exports But yes this should be supported, I'll look into it |
Did some try |
I'm using a subset of the
I can't find the module support though. it just seems to work with both webpack's babel-loader and rollup-babel-plugin. |
Thanks |
The transformer fails when the class declaration is part of an Export declaration cf: #24 this commit moves the class declaration out of the named and default exports It then exports them using the class identifier
So current state is working, but will still try to make it better Instead of failing it now transforms export default class TreeWalker {
// empty test
} Into function TreeWalker() {
// empty test
}
export default TreeWalker and export class TreeWalker {
// empty test
} Into function TreeWalker() {
// empty test
}
export { TreeWalker } Note that I realize it is kind of a workaround. export default function TreeWalker() {
// empty test
} and export function TreeWalker() {
// empty test
} I'll spend a little more time to get what's going wrong |
Hello,
thank you for making this great alternative for babel's class-transform. the spec-compliant version seems rather heavy, especially after d. walsh on prototypes (link in the readme?).
When I try to export and declare a class on the same line, I get the following error:
Here goes
/src/dom/treewalker.js
My solution for now is to put the export on a seperate line.
The text was updated successfully, but these errors were encountered: