Skip to content
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

handle custom init in ESM format #1083

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open

Conversation

qbikez
Copy link

@qbikez qbikez commented Sep 13, 2022

Custom init script is very useful, but it lacked the support for module type scripts.
Modules make it possible to import other files, so you don't have to put all the code into init.js.

This PR adds handling of init.esm.js script as type=module.

@evilz
Copy link
Owner

evilz commented Sep 13, 2022

Why do you need this ?

@qbikez
Copy link
Author

qbikez commented Sep 13, 2022

I wanted to use a custom plugin, but didn't find a way to include js files other than init.js. I wanted to keep things modular and not put everything into init.js and wanted to avoid any additional build steps.
At first, I added a custom list of js files to libs.ejs, the same way custom css is done. But then I realized I could use ECMAScript modules and have nice, modern imports.

@evilz
Copy link
Owner

evilz commented Sep 13, 2022

Ok cool I see

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants