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

Javascript files with .cjs extension can not be transpiled #10339

Closed
rchl opened this issue Mar 19, 2022 · 2 comments · Fixed by #10340
Closed

Javascript files with .cjs extension can not be transpiled #10339

rchl opened this issue Mar 19, 2022 · 2 comments · Fixed by #10340

Comments

@rchl
Copy link

rchl commented Mar 19, 2022

The pattern used for babel-loader doesn't include the .cjs extension thus trying to transpile a module that has *.cjs export doesn't have an effect.

See also unjs/ufo#50

Versions

  • nuxt: 2.15.8
  • node: 14

Reproduction

Try to use anything from ufo on the client-side. The resulting bundle will include a spread operator but should be transpiled because Nuxt transpiles ufo by default (https://github.com/nuxt/nuxt.js/blob/777a4b7f5033c86c37cbd93008f3ca792e4af8bc/packages/webpack/src/config/base.js#L78-L78).

Steps to reproduce

What is Expected?

What is actually happening?

https://github.com/nuxt/nuxt.js/blob/777a4b7f5033c86c37cbd93008f3ca792e4af8bc/packages/webpack/src/config/base.js#L332-L332

@stale
Copy link

stale bot commented Apr 19, 2022

Thanks for your contribution to Nuxt!
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
If you would like this issue to remain open:

  1. Verify that you can still reproduce the issue in the latest version of nuxt-edge
  2. Comment the steps to reproduce it

Issues that are labeled as pending will not be automatically marked as stale.

@stale stale bot added the stale label Apr 19, 2022
@rchl
Copy link
Author

rchl commented Apr 19, 2022

There is a PR.

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

Successfully merging a pull request may close this issue.

2 participants