• Home
  • Categories
  • Recent
  • Popular
  • Top
  • Tags
  • Users
  • Groups
  • Documentation
    • Home
    • Read API
    • Write API
    • Plugin Development
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
v3.5.2 Latest
Buy Hosting

howto: enable ES6 compilation?

Scheduled Pinned Locked Moved Technical Support
2 Posts 2 Posters 863 Views
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Bruce LeeB Offline
    Bruce LeeB Offline
    Bruce Lee Anime Lovers
    wrote on last edited by
    #1

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

    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!

    1 Reply Last reply
    0
  • yariplusY Offline
    yariplusY Offline
    yariplus Community Rep
    wrote on last edited by yariplus
    #2

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

    1 Reply Last reply
    2

Copyright © 2023 NodeBB | Contributors
  • Login

  • Don't have an account? Register

  • Login or register to search.
Powered by NodeBB Contributors
  • First post
    Last post
0
  • Home
  • Categories
  • Recent
  • Popular
  • Top
  • Tags
  • Users
  • Groups
  • Documentation
    • Home
    • Read API
    • Write API
    • Plugin Development