howto: enable ES6 compilation?

  • Anime Lovers

    Some of my scripts are written with ES6 syntax, "let" instead of "var".

    let leftLabel = 'hello world';

    When I try to start nodebb, using the command:

    ./nodebb start

    It will throw the following exception:

    [meta/js] Could not compile nodebb.min.js: Unexpected token: name (leftLabel)

    Please advise me how to enable ES6 compilation, thanks!

  • Community Rep

    The minifier NodeBB currently uses does not support ES6 compilation, you will need to transpile your code into ES5 using Babel.



Looks like your connection to NodeBB was lost, please wait while we try to reconnect.