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

Switch to ES6 modules #57

Merged
merged 1 commit into from
Sep 24, 2022
Merged

Switch to ES6 modules #57

merged 1 commit into from
Sep 24, 2022

Conversation

reconman
Copy link
Collaborator

This is a breaking change, the config.js needs to be defined in ES6 format as indicated by the modified config.example.js.

@Ardakilic Ardakilic merged commit 3524829 into Ardakilic:master Sep 24, 2022
@Ardakilic
Copy link
Owner

Heya, Apologies for the late reply. Apparently I never got notified about this.

Thanks! This looks awesome! Merging it 😊

@Ardakilic
Copy link
Owner

Also, I just invited you as collaborator, for not blocking for such stuff. Thanks again!

@reconman
Copy link
Collaborator Author

I had to revert the type: module line in package.json because of rss-braider. d1dd5df

That library can only handle files with .js endings and imports them via the CommonJS syntax of require. You can mark CommonJS files in Node with .cjs, but then rss-braider doesn't pick them up correctly.

So the only way out was to tell Node to treat any .js file as CommonJS module and then mark all ES modules with .mjs file extensions.

Since the rss-braider plugins need to be CommonJS modules and one of them imports utils/Alerthub.js, I also had to revert that file to a CommonJS module.

Btw, if you have Discord, my username is reconman#0562.

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.

2 participants