-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Rollup Error: Could not resolve '../dom' from src/preact/src/vdom/diff.js #792
Comments
Could you please post your Are you using |
It's a pretty simply rollup config: export default {
entry: 'src/main.js',
dest: 'build/main.js',
format: 'iife',
plugins: [],
sourceMap: true
} I'm not using the node resolve plugin. Like I said, I'm including this repo as a submodule directly in my |
Thanks for posting your config, it looks like you may be experiencing rollup/rollup#346. Would it be acceptable to add |
I'd rather avoid needing a plugin for such a tiny thing. If you just add It's up to you, but I think such a small and simple change on your end would simplify consuming the library for me quite a bit. |
Should take care of preactjs#792
I don't really have a preference here, but this solution is not very "small and simple" if you consider the hundreds of If this helps your with use case that is great, but I suppose I am not understanding the aversion to the use of |
Well, I checked and the plugin is much lighter-weight than I expected (npm dependencies tend to be giant).
My project doesn't have a I understand I'm fairly unique and most JS developers already use npm and much larger You also bring up a very good point about third-party components that depend on the node resolution strategy. Again I'm a unique case and am not consuming any existing components and so am not affected by this. Even the 14 bytes added to preact won't affect me because I'm using rollup and it erases all the import and exports statements by just inlining everything together. The choice is yours, I respect your preferences as the maintainer. Just a humble request to help simplify for my fairly odd workflow. |
Thanks for explaining the use case. I understand the desire to keep the dependency tree shallow and easy to understand, and since Since it doesn't affect performance I wouldn't mind seeing this merged, but I can't really speak with authority on whether it's worth the change. Either way thank you for explaining the details of your use case. |
I'm happy to make the change - one of the index files is due for renaming anyway. |
I'm trying to use preact with rollup, but no babel. I hit a small snag that should be easy to fix.
I have this repo as a submodule directly in my
src
folder and am trying to use it like this:The problem is
src/vdom/component.js
andsrc/vdom/diff.js
both importdom
as simply../dom
, but they need to be../dom/index
because rollup's default search path doesn't support auto index on folders.Once I tweak those two files, it seems to bundle just fine.
The text was updated successfully, but these errors were encountered: