How to compile a standalone ES6/ESNext Javascript file in Sage 9

I’ve read through many examples on here with regards to including/importing Javascript files but I do not want that. I’m trying to set up a standalone file that I’d like compiled and I will enqueue it myself (It’s a Gutenberg block).

How to tell Sage 9 that this is an ES6 file and to compile it? (output to dist)

Add a new entry in resources/assets/config.json. Then create the file in resource/assets/scripts. Sage uses Bublé to compile ES2015 (same as ES6).

1 Like

This topic was automatically closed after 42 days. New replies are no longer allowed.