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

replace .m.js with .mjs to be working in Node ESM #3

Merged
merged 1 commit into from
Jul 16, 2020
Merged

replace .m.js with .mjs to be working in Node ESM #3

merged 1 commit into from
Jul 16, 2020

Conversation

talentlessguy
Copy link
Contributor

Node.js requires either .mjs extension or "type": "module" + .cjs for CommonJS to work.

Here I've chosen the easiest way, changing .m.js to .mjs so it works.

It also works in browser (if it's even needed lol)

I tried to build and import sosse and it worked without crashes

@katywings
Copy link
Contributor

katywings commented Jul 16, 2020

@talentlessguy Thank you a lot for this pr and your investigation!


I just asked about this in the microbundle chat and got informed about some really annoying history: It looks like many different projects switched from *.js to .mjs and had to revert to ".js" because of other bundler/webpack issues 🙈 ...

A couple examples:


Normally I would say "lets wait for the others / webpack to iron this out". But I think in this case lets go for it, since webpack really isn't a clear "platform" for sosse :D - but i have to give you a little "warning" notice: if mjs results in other yet unknown but major problems, I will have to revert this again ;).

@katywings katywings merged commit 5f840e7 into sossejs:master Jul 16, 2020
@talentlessguy
Copy link
Contributor Author

@katywings oh, this is unfortunate

is there a better solution?

for now maybe let's keep it like that until bad things happen (if they happen)

@katywings
Copy link
Contributor

katywings commented Jul 16, 2020

for now maybe let's keep it like that until bad things happen (if they happen)

yeah :)

is there a better solution?

Fixing webpack? :P


But thank you again for your work 🥳 !

@talentlessguy
Copy link
Contributor Author

@katywings could you please publish the patch version so I could use it :)?

@katywings
Copy link
Contributor

@talentlessguy v0.6.0 is out with your change, and a little new feature of mine ;)

@talentlessguy
Copy link
Contributor Author

@katywings yay thanks

katywings pushed a commit that referenced this pull request Jul 25, 2020
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