Skip to content
This repository was archived by the owner on Jan 26, 2019. It is now read-only.
This repository was archived by the owner on Jan 26, 2019. It is now read-only.

tsconfig should exclude files from public directory #159

@ianschmitz

Description

@ianschmitz

Is this a bug report?

Yes

Can you also reproduce the problem with npm 4.x?

Yes

Environment

  1. npm ls react-scripts-ts (if you haven’t ejected): 2.6.0
  2. node -v: 8.4.0
  3. npm -v: 5.3.0

Then, specify:

  1. Operating system: Windows 10

Steps to Reproduce

(Write your steps here:)

  1. Copy node_modules folder to public directory
  2. Run npm start
  3. Notice errors during startup in console. For example i see error:
C:\projects\test\node_modules\@types\node\index.d.ts
(43,11): error TS2451: Cannot redeclare block-scoped variable 'Error'.

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:

  1. Add public to exclude array in tsconfig.json. or
  2. Replace exclude array with include array with src/**/* 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions