-
Notifications
You must be signed in to change notification settings - Fork 18
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
feat: add moduleName option #47
base: main
Are you sure you want to change the base?
Conversation
I'm not sure what problem this solves, can you provide an example? |
Refer to this PR, the final solution is to use alias to redirect to the correct path. It would be even better if custom module name could be supported. |
@inottn I'm not sure I follow, why was I would assume it's because of this: but I would also need to ask why |
@lxsmnsyc If I have any misunderstandings, please feel free to correct me. This plugin does something similar to what vite-plugin-solid does, because users do not directly depend on solid-refresh, so they may not be able to resolve solid-refresh to the correct path during runtime. Therefore, it needs to be handled on the plugin side. |
this part is the one I'm not sure, since the rsbuild plugin is dependent on solid-refresh, I would assume it would be able to resolve it? on the other hand, I'm not familiar with how rspack resolves modules but have you tried if it would work without the whole Honestly the only reason we are doing this in Vite is so that we can alias |
@lxsmnsyc Thank you for providing information about Vite. I encountered a module resolution error when I didn't use |
@inottn One final question, is this line necessary? edit: would this also be helpful? pnpm/pnpm#5237 (comment) |
Yes, this is necessary. Thank you for your patient response. I ran Assume this code can be removed if all users use npm or yarn, because all dependencies will be flattened in the root node_modules. |
I'll have to take some time to judge this. The thing is this is the only specific case where it doesn't work. Kinda of unexpected because I assume the webpack and rspack demos worked properly |
Hope to provide a option that can customize the module name. When this option is not passed in, the default is to use 'solid-refresh'.