0

I've created a React app for a new shared component. I've used rollup.js to bundle the files into a dist folder in the app.

I copied the dist folder and pasted it underneath the src folder in a separate React app where I wanted to locally npm install the dist folder for test purposes.

This Stack Overflow question says that I should be able to locally npm install the dist with the following command:

npm install --save ./src/dist

I locally npm installed as described above, but when I try to npm start my test app, the following error message is written to the console:

Module not found: You attempted to import C:\apps\my-test-app/../dist which falls outside of the project src/ directory. Relative imports outside of src/ are not supported.

Any idea what I might be doing wrong here? Seems like I've done everything according to instructions but I'm sure that I'm not the first person who has experienced this

Arnav Thorat
  • 2,632
  • 2
  • 5
  • 27
react0r
  • 45
  • 4

0 Answers0