Skip to content

Creation of production build is compiling files in __mocks__ folders #6330

Description

@MKMZ

Is this a bug report?

Yes

Did you try recovering your dependencies?

Yes

Environment

Environment Info:

System:
OS: Windows 10
CPU: x64 Intel(R) Core(TM) i7-6820HQ CPU @ 2.70GHz
Binaries:
npm: 6.4.1 - C:\Program Files\nodejs\npm.CMD
Browsers:
Edge: 42.17134.1.0
Internet Explorer: 11.0.17134.1
npmPackages:
react: ^16.7.0 => 16.7.0
react-dom: ^16.7.0 => 16.7.0
react-scripts: 2.1.3 => 2.1.3
npmGlobalPackages:
create-react-app: Not Found

Steps to Reproduce

I noticed that react-scripts build command is compiling files from __mocks__ folder (where manual mocks are stored to be used by jest). I have imported "devDepencency" to one .ts file in such folder and building process has failed.

(Write your steps here:)

  1. Create project with __mocks__ folder.
  2. Add "devDependency" to file in __mocks__ folder.
  3. Try to build the solution.

Expected Behavior

Solution has compiled successfully.

Actual Behavior

Compilation has failed, because cannot find dependency in mock file.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions