Lobos / react-ui

A collection of components for React, base on bootstrap 4.0.
http://lobos.github.io/react-ui/
MIT License
1.63k stars 302 forks source link

npm上的dist包语法有问题!? 0.7 #78

Closed youwi closed 7 years ago

youwi commented 7 years ago

引用了rctui0.7以后,我自己的项目打包生成main.js出语法错误

/**

  • Add a style variant to a Component. Mutates the propTypes of the component
  • in order to validate the new variant. */ function addStyle(Component) { for (var _len2 = arguments.length, styleVariant = Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) { styleVariant[_key2 - 1] = arguments[_key2]; }

    bsStyles(styleVariant, Component); }

    var _curry = exports._curry = curry;

// }, / 15 / // function(module, exports) {

import './styles/reset.scss'

export { default as Button } from './Button' export { default as ButtonGroup } from './ButtonGroup' export { default as Checkbox } from './Checkbox' export { default as CheckboxGroup } from './CheckboxGroup' export { default as Datepicker } from './Datepicker' export { default as Datetime } from './Datepicker' export { default as DatepickerPair } from './Datepicker/Range' export { default as DatepickerRange } from './Datepicker/Range' export { default as Icon } from './Icon' export { default as Input } from './Input' export { default as InputGroup } from './InputGroup' export { default as Radio } from './Radio'

0.6.7版本没有这个问题

Lobos commented 7 years ago

0.7 我把UI转到bootstrap了,需要配置scss的loader

nickzengcn commented 7 years ago

我已经配置了scss的loader了,发现还是没法解决这个问题 js报Uncaught SyntaxError: Unexpected token import

Lobos commented 7 years ago

https://github.com/Lobos/react-ui/blob/master/cli/webpack.config.js 按这个文件配置一下webpack试试

youwi commented 7 years ago

发布的dist的包下应该只有js普通语法.你这样搞增加使用者的负担,建议重新配置. 另外scss也应该单独打包为css文件,同时提供scss文件.---我看好多项目都有备用配置.