-
Notifications
You must be signed in to change notification settings - Fork 490
tsconfig should exclude files from public directory #159
Comments
After considering #152, a potential solution could be something like: "include": [
"src/**/*"
],
"exclude": [
"src/setupTests.ts",
"src/**/*.{test,spec}.{ts,tsx}",
"src/**/__tests__/*"
] |
While adding an exclusion or an explicit inclusion should not be a problem, I don't understand why anyone should do this:
Can you elaborate the use case for this? It's just that this folder is not intended for source files, neither your own nor those from libraries. If you really have to serve content from the |
Yes agree with @DorianGrey, seems like an odd use case. However, I do think we should only be including the |
Sorry I should have elaborated. Im not proposing to try to support node modules in the public directory. It was simply an easy way to reproduce the fact that the it appears files inside public are being consumed by typescript. |
The explicit property declaration is based on comment from: wmonk#159 https://git.io/v5hxz and TS handbook: https://git.io/v5hxK Thanks!
Is this a bug report?
Yes
Can you also reproduce the problem with npm 4.x?
Yes
Environment
npm ls react-scripts-ts
(if you haven’t ejected): 2.6.0node -v
: 8.4.0npm -v
: 5.3.0Then, specify:
Steps to Reproduce
(Write your steps here:)
node_modules
folder topublic
directorynpm start
Expected Behavior
Only files from
src/
should be included in build.Actual Behavior
Files from
public/
are included.An easy solution was for me to either:
public
toexclude
array intsconfig.json
. orexclude
array withinclude
array withsrc/**/*
as only element.It seems to me that 2 is preferable if we intend only to be looking at the
src
directory. There may be drawbacks that I'm not aware of.The text was updated successfully, but these errors were encountered: