-
-
Notifications
You must be signed in to change notification settings - Fork 40
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
Could not resolve './foo' from example/index.js #4
Comments
@ws456999 can you try this? foo/index.tsx export default class Foo {
render() {
return <div className="hehe">hello there!!!</div>
}
} index.js import Foo from './foo/index'
console.log(Foo) |
@aelbore , foo/index.tsx
index.js
works in rollup with rollup-plugin-typescript my project have too much such case, |
@ws456999 the thing is if you have foo/index.tsx and foo.tsx exist |
@aelbore It's two question,
I only care about the first question,Do you have any ideas? |
@aelbore and yes esbuild doesnt resolve like Node resolution const coreModule = (resolved: string) => {
if (existsSync(resolved) && statSync(resolved).isDirectory()) {
for (const loader of loaders) {
const file = join(resolved, `index.${loader}`)
if (existsSync(file)) {
return file
}
}
}
return null
}
const loadFile = (resolved: string) => {
for (const loader of loaders) {
const file = `${resolved}.${loader}`
if (existsSync(file)) {
return file
}
}
return null
}
let file = loadFile(resolved)
if (file) return file
if (!file) {
file = coreModule(resolved)
if (file) return file
}
|
@aelbore |
looking forward to your next version |
when i move
foo.tsx
tofoo/index.tsx
cound't resolve module correctly
The text was updated successfully, but these errors were encountered: