我有一个要在 npm 中发布的组件,我只是通过从项目的 components 文件夹中导入它来进行测试。
我设法发布它,但现在我得到:
错误在./node_modules/@ / /index.jsmodule解析失败:意外的令牌(11:8)您可能需要适当的加载程序来处理此类文件。
我的 index.js 如下:
import React from "react"
import Main from "./bootstrap/containers/main"
export default class BootstrapTable extends React.Component {
constructor(props) {
super(props)
}
render() {
return (
<Main {...this.props} changePage={(p) => this.props.changePage(p)}/>
)
}
}
旁注:我不需要更改 webpack 配置,因为它应该可以正常工作,就像我目前使用的许多其他包一样。