Uh oh!
There was an error while loading. Please reload this page.
feat: add moduleName option - #47
Conversation
lxsmnsyc
commented
Nov 29, 2023
I'm not sure what problem this solves, can you provide an example? |
inottn
commented
Nov 29, 2023
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. |
lxsmnsyc
commented
Nov 29, 2023
@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 |
inottn
commented
Nov 29, 2023
@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. |
lxsmnsyc
commented
Nov 29, 2023
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 |
inottn
commented
Nov 29, 2023
@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) |
inottn
commented
Nov 29, 2023
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. |
lxsmnsyc
commented
Nov 29, 2023
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'.