-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Absolute module imports through node_modules symlinks with Plug'n'Play #6616
Comments
I think what you're looking for is the |
Oh thanks, undocumented Yarn feature? |
Got past the linked dependencies with this but now failing with Babel plugins:
|
I'm running minimal configuration of babel for styled-components and hot loading:
Same happens when I move config out to EDIT: Looks like |
Ok, found the found the comment about facebook/create-react-app#5215 (comment) babel function config |
Do you want to request a feature or report a bug?
bug?
What is the current behavior?
We are using
node_modules
insidesrc
folder for symlinking to have short absolute imports for commonly used folders:With PnP this behaviour is lost:
Error: You cannot require a package ("types") that is not declared in your dependencies (via "src/api/client.ts")
Symlinks are a nice tool-agnostic way of enabling this, see Dan's comment - facebook/create-react-app#5136 (comment)
If the current behavior is a bug, please provide the steps to reproduce.
node_modules
folderWhat is the expected behavior?
PnP should either provide a way to allow locally symlinked source folders through or
document migration path / alternatives.
One option would be to write all those imports to relative, as they are a bit magic - making it a bit hard to distinguish between published modules and local. Although in the project I'm testing PnP, there are a few thousand absolute imports.
@arcanis Any ideas?
Please mention your node.js, yarn and operating system version.
Node.js v10.13.0
Yarn v1.12.1 with --pnp enabled
macOS 10.12.6
Webpack 4.20.2
pnp-webpack-plugin 1.2.0
ts-loader 5.3.0
The text was updated successfully, but these errors were encountered: