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

Source map points to missing source files #33

Closed
joewagner opened this issue Apr 7, 2022 · 2 comments
Closed

Source map points to missing source files #33

joewagner opened this issue Apr 7, 2022 · 2 comments

Comments

@joewagner
Copy link
Contributor

The build of this code base that is published to npm contains .map files with reference to the src directory. The src directory is not published to npm which means that frontend tooling like Vite send out many Warnings anytime this package is used.

look in dist/esm/src/main.js.map, you will see the following JSON

{"version":3,"file":"main.js","sourceRoot":"","sources":["../../../src/main.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAC7C,cAAc,iBAAiB,CAAC"}

Note that the "sources" property refers to ../../../src/main.ts. That file is not published to npm, hence the warnings from Vite

@joewagner
Copy link
Contributor Author

Looks like the "files" prop in package.json is used to exclude the src/ directory

@carsonfarmer
Copy link
Member

Yup exactly, we can just add the src dir to files to fix this.

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