babel-starter-kit icon indicating copy to clipboard operation
babel-starter-kit copied to clipboard

`package.json` has wrong path for `index.js` at `main`

Open joelalejandro opened this issue 8 years ago • 2 comments

The template for package.json defines main as index.js, when there's no index.js file on the root of the project. It's either on src/ or dist/.

--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/37967673-package-json-has-wrong-path-for-index-js-at-main?utm_campaign=plugin&utm_content=tracker%2F18782092&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F18782092&utm_medium=issues&utm_source=github).

joelalejandro avatar Sep 17 '16 21:09 joelalejandro

In the tools/build.js file, the package.json file gets rewritten to the dist directory, which I think is the point for distributing the package to npm, and the pointer then is correct at that point ... But yeah, wouldn't work if you're just working with it locally. Optionally, could just do what you have done here, and then change the build.js file to do a replace on dist/index back to 'index' ... I think that's what's going on.

mattjcowan avatar Nov 14 '16 00:11 mattjcowan

I set in project.json

"main": "dist/index.js"

brianzinn avatar Jan 14 '17 06:01 brianzinn