[es-dev-server]: node resolution with yarn workspaces goes out of the root directory
See original GitHub issueI’m trying to create a mono repo using yarn workspaces, with an example directory where I want to run es-dev-server.
root | |__ example | |_ node_modules (empty as everything has been hoisted) | |_ Trying to run es-dev-server here | |___ node_modules |_ This is the actual place where `import "anything"` resolves to
When I try to run es-dev-server it gives the error
Error compiling: Import “tslib” resolved to the file “/home/viks/root/node_modules/tslib/tslib.es6.js” which is outside the web server root, and cannot be served by es-dev-server. Install the module locally in the current project, or expand the root directory. If this is a symlink or if you used npm link, you can run es-dev-server with the --preserve-symlinks option
I’m using yarn and don’t want to fallback to using npm with npm link. Changing the rootDir is also cumbersome since too many paths have to be adjusted in a non-trivial manner.
Can we get an option to specify a separate workspaceRoot that default to rootDir but can be above rootDir if needed?
Issue Analytics
- State:
- Created 4 years ago
- Reactions:2
- Comments:12 (9 by maintainers)
Top GitHub Comments
We had some discussions in the team about the multiple directories, but not everyone was quite convinced 😃
Perhaps we need to make this more explicit in the docs.