I am using the latest preact, but it looks like a webpack issue to me.
Let’s say my folder structure is:
- app
- foo
- index.js
- app.js
- foo
- bar
- baz
- index.js
- baz
app/app.js
import { foo } from './foo'
import { baz } from '../bar/baz'
...
app/foo/index.js
const foo = () => { ... }
export { foo }
bar/baz/index.js
const baz = () => { ... }
export { baz }
It fails to bundle with a warning “export ‘baz’ was not found in ../bar/baz
But, if I make it a default export like
bar/baz/index.js
const baz = () => { ... }
export default baz
and update app.js to
app/app.js
import { foo } from './foo'
import baz from '../bar/baz'
...
everything works fine
Just wondering how is it possible that “local” directory reference resolves fine, but level up – can’t be resolved in a list export.