我正在尝试在我rollup.config.js
的复制品中添加样式组件,但它会引发错误。我有类似的问题,react-router-dom
并通过在外部重命名react-router-dom
为.react-router-dom/Link
rollup.config.js
怎么办styled-components
?
再生产:
// rollup.config.js
export default {
...
external: ['react', 'react-router-dom/Link', 'styled-components'],
...
globals: { react: 'React', 'react-router-dom/Link': 'Link', 'styled-
components: 'styled' },
};
实际行为:使用汇总构建时引发错误
(babel plugin) An unexpected situation arose. Please raise an issue at
https://github.com/rollup/rollup-plugin-babel/issues. Thanks!
node_modules/styled-components/dist/styled-components.es.js
版本样式组件: 2.0.1
版本汇总-插件-babel: 2.7.1