I’ve read different docs already but was unable to find something that explicitly states that npm run build
excludes spec files by default.
I tried inspecting the main.js
file in dist
folder but contents of my spec files weren’t there does it necessarily mean that it was excluded during the build?
jaki is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
1
The builder typically exclude everything not imported in your ts files, this is done via treeshaking, hence it will not be includes. But typically you will also see in the tsconfig.spec.ts file it includes *.spec.ts files in there, and hence they only get build via npm run tests if you have that listed in your package.json.
So in short. No should not be included.