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

wrong index.js path in package #10

Closed
almorak opened this issue Dec 4, 2019 · 1 comment
Closed

wrong index.js path in package #10

almorak opened this issue Dec 4, 2019 · 1 comment

Comments

@almorak
Copy link

almorak commented Dec 4, 2019

package json :
...
"main": "build/index.js",
...

but there is no build folder, need to manually change it to
"main": "src/index.js",

@barrsan
Copy link
Owner

barrsan commented Dec 4, 2019

Hello @almorak! The build directory is placed in .gitignore, because it makes no reasons to put it in this repository.

From the npm documentation:

The main field is a module ID that is the primary entry point to your program. That is, if your package is named foo, and a user installs it, and then does require("foo"), then your main module’s exports object will be returned.

The build directory is published in the npm repository. You can check the .npmignore file and make sure that it does not include the build directory path.

If you need the build directory, you can build the package using the npm run build command.

If use "main": "src/index.js", then when we import the package into the target file from node_modules, the dev version will be used.

@almorak almorak closed this as completed Dec 5, 2019
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

No branches or pull requests

2 participants