I don’t really understand the first question because you have elided some important details, but for the second question, there’s a “files” key you can set in package.json that specifies which files to include in the package tarball. If you set that to some pattern that excludes your tests, they will not be included. Alternatively, you can create a .npmignore file.
this post was submitted on 23 Jan 2024
9 points (100.0% liked)
JavaScript
2182 readers
1 users here now
founded 2 years ago
MODERATORS
Thank you, I've used files
to exclude them from the bundle. :)
In all seriousness, this is a fine scenario for AI guided learning. I gave Bing Copilot your question, and the response was very helpful.
Here's the trick though:
// In 'firereact/firestore/index.ts'
export { useDocument } from './useDocument';
and:
// In 'tsconfig.json'
{
"compilerOptions": {
// ...
},
"exclude": ["**/*.test.ts", "**/*.spec.ts", "path/to/firebase.ts"]
}
Yep, tried ChatGPT on that but screwed up the project and had to revert back to an older tag for it, but I will try this surely.