umijs / babel-plugin-import

Modularly import plugin for babel.
3.16k stars 405 forks source link

怎么配置才能支持export defaualt的导出? #324

Open Coder-JJ opened 5 years ago

Coder-JJ commented 5 years ago
// package/index.js

export default A
// 业务代码中
import A from 'package'

结果:报A is not defined错误

zhusjfaker commented 5 years ago

我也报同样的错啊......内心持续崩溃中

zhusjfaker commented 5 years ago

image

zhusjfaker commented 5 years ago

import * as React from 'react'; import styles from './index.module.scss'; import { Conversion } from '../util/conversion'; import { CookieService } from '../util/cookie';

interface IYouKuFooterProps {

}

interface IYouKuFooterState { trans: boolean; isclient: boolean; }

export default class XXXFooter extends React.Component<IYouKuFooterProps, IYouKuFooterState> {

ForeverTali commented 5 years ago

你可以尝试下 import A from 'package/index' 虽然有点别扭,但是可行

grtan commented 4 years ago

我也报同样的错啊......内心持续崩溃中

+1,同样有这问题,貌似不支持默认导入