-
Notifications
You must be signed in to change notification settings - Fork 49
refactor test import path, remove redundancy index.js #13
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
Labels
Comments
其实就是为了给 example 或者 test 里面 import Foo from 'rc-foo' 来做 alias 的... @yesmeck 默认 alias 做一个 fallback , 先取 |
paranoidjk
added a commit
to react-component/notification
that referenced
this issue
Jul 31, 2017
paranoidjk
added a commit
to react-component/tooltip
that referenced
this issue
Aug 6, 2017
paranoidjk
added a commit
to react-component/tooltip
that referenced
this issue
Aug 6, 2017
Goal
Proposalimport { foo } from 'rc-component'; // will redirect to import { foo } from 'rc-component/index.js' or import { foo } from 'rc-component/src/index.js'
import foo from 'rc-component/lib/foo'; // will redirect to import foo from 'rc-component/src/foo.js' |
对于 ts 的项目,没有 /index.js, 只有 /src/index.tsx 这种情况下 alias 到 src/index.tsx 是不行的,因为 ts 不能当 webpack entry。 直接 src/index.js 也不行, 因为 compile to lib 和 es 的时候会出问题 @yesmeck 有空处理下这个么? |
paranoidjk
added a commit
to react-component/swipeout
that referenced
this issue
Jun 12, 2018
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
ref: react-component/tree-select#62
踩了个坑,nodejs 读目录会优先尝试 pkg.main, 失败才会 fallback 到 index.js
https://github.com/nodejs/node/blob/master/lib/module.js#L115
所以用例里面
import TreeSelect from '..';
会优先引用到 lib。cc @react-component/admin
The text was updated successfully, but these errors were encountered: