question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Support index.web.js entry file

See original GitHub issue

This is similar to “Support index.jsx entry file #3052”. I’m playing around with react-primitives and naturally I have multiple entry points into my app. After reading the reasons why #3052 was closed, I still think that index.web.js is a valid use case. Thank you for consideration.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:2
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

3reactions
viankakrisnacommented, Jan 31, 2018

https://github.com/facebook/create-react-app/issues/3052#issuecomment-356114916 suggest that if it’s easy, they are happy to take a PR.

I think the one way to do it without fiddling with webpack config is to let node’s own module resolution takes care of this.

https://github.com/facebook/create-react-app/blob/next/packages/react-scripts/config/paths.js#L56 -> instead of hard-coding src/index.js we can move it to just src, and the user can create a package.json there with main property pointed to any file the user like.

1reaction
brunolemoscommented, Oct 23, 2018

This is on master since #4837.

These are now accepted as an entry point:

  • index.js
  • index.jsx
  • index.mjs
  • index.ts
  • index.tsx
  • index.web.js
  • index.web.jsx
  • index.web.mjs
  • index.web.ts
  • index.web.tsx

You can close this issue. 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

Entry Points - webpack
webpack.config.js module.exports = { entry: './path/to/my/entry/file.js', };. The single entry syntax for the entry property is a shorthand for:.
Read more >
How to Create Index.js File in Node? - KnowledgeHut
Here is another way to use the index.js file in NodeJs. Let's use Axios to retrieve a bulk of users from the Jsonplaceholder...
Read more >
Conventions for app.js, index.js, and server.js in node.js?
json file via npm init , one is prompted for the main entry point file. The default is given as index.js . In...
Read more >
React Native Web platform specific web.js extension
Out of the box, React Native is configured to automatically import files based on the platform being used. For example, you could have...
Read more >
Multi-platform setup // React Native for Web
Additionally, 3rd party React Native packages with web support are ... (see the webpack configuration below for resolving *.web.js files):.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found