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

Add .cjs extension support #8754

Closed
TrySound opened this issue Mar 31, 2020 · 0 comments
Closed

Add .cjs extension support #8754

TrySound opened this issue Mar 31, 2020 · 0 comments

Comments

@TrySound
Copy link

Describe the bug

.cjs extension is a thing in node.js now, though cra blocks its usage with file-loader

loader: require.resolve('file-loader'),
// Exclude `js` files to keep "css" loader working as it injects
// its runtime that would otherwise be processed through "file" loader.
// Also exclude `html` and `json` extensions so they get processed
// by webpacks internal loaders.
exclude: [/\.(js|mjs|jsx|ts|tsx)$/, /\.html$/, /\.json$/],

See the issue here
ai/nanoid#205

Did you try recovering your dependencies?

Not an issue

Which terms did you search for in User Guide?

Not an issue

Environment

Not relevant

Steps to reproduce

  1. install nanoid@3.0.2
  2. try to import * as nanoid from 'nanoid'; and console.log(nanoid)
  3. { default: './index.js' }

Expected behavior

Load module instead, not path

Actual behavior

Path is loaded

Reproducible demo

Not relevant

@TrySound TrySound closed this as completed Apr 1, 2020
@lock lock bot locked and limited conversation to collaborators Apr 15, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant