mattdesl / budo

:clapper: a dev server for rapid prototyping
MIT License
2.18k stars 106 forks source link

javascript class specification doesn't work? #222

Closed nyenye closed 6 years ago

nyenye commented 6 years ago

This is the code:

class Ghost {
    constructor(name) {
        this.name = name
    }

    scare() {
        console.log('buuuuu')
    }
}

module.exports = Ghost

This is the error: SyntaxError: Unexpected token: name (Ghost) while parsing file

I've also tried other syntaxes like: const Ghost = class {} or const Ghost = class Ghost {} all of them with no luck.

Is it not possible to use class syntax with budo?

nyenye commented 6 years ago

Alerady solved it. Missing some bable plugins.