Comments (17)
babel-plugin-antd 的文档也太简单了,完全不知所云。
依然搞不清楚,为什么会出现这个提示? 为什么要有这个提示。
为什么要用babel-plugin-antd,用了有什么好处
怎么用babel-plugin-antd...... 一堆疑问
from babel-plugin-import.
您好,使用babel-plugin-import的时候经常会有一个问题:当我加载一个子Component的时候,它会引起import插件的自动加载style功能,例如import {Menu,SubMenu} from 'antd',就会报错sub-menu/style不存在,请问有什么方法解决吗?谢谢
from babel-plugin-import.
@afc163 这个提示是根据什么判断做出的?
from babel-plugin-import.
同问
from babel-plugin-import.
https://github.com/ant-design/ant-design/blob/master/index.js
走这个文件就会出现,直接 import 'antd/lib/xxx'
或是用了 babel-plugin-antd 就不会出现,楼主应该是不会配置 babel-plugin
from babel-plugin-import.
from babel-plugin-import.
@afc163 我也知道直接 import 'antd/lib/xxx',不会出现提示,但问题是这样做的话引用的组件一多就非常麻烦了,所以才想问问怎么使用babel-plugin-antd。具体要配置哪里呢?
from babel-plugin-import.
报错:Module build failed: Error: Plugin 1 specified in "/Users/panda/workspace/olympus/mobile/.babelrc" provided an invalid property of "style"
.babelrc添加配置:
"plugins": [
"antd", {"style": true}
]
请问是这么配置么?
from babel-plugin-import.
同问
from babel-plugin-import.
https://github.com/ant-design/babel-plugin-antd#usage
from babel-plugin-import.
前两天一直在忙着研究组件,今天再看了一下,终于把问题解决了.按官方文档先安装babel-plugin-antd,然后在webpack.config.js的loaders里面jsx这一项添加一个plugins: [['antd', {style:'css'}]],就可以了.希望对有相同问题的同学有用.
from babel-plugin-import.
还是不能用,报错:
Module build failed: TypeError: The plugin ["antd",{"style":"css"}] didn't export a Plugin instance
from babel-plugin-import.
我当时的解决办法是 babel 版本升级到6以上,之前用的是5,但随之会引来新的问题,google 后解决
from babel-plugin-import.
同问呀
from babel-plugin-import.
@hust419 对的,完全搞不清楚这个插件是干嘛的。
from babel-plugin-import.
https://ant.design/docs/react/getting-started-cn 文档里面有说明的
from babel-plugin-import.
Note:
babel-plugin-import will be not working if you add the library in webpack config vendor.
from babel-plugin-import.
Related Issues (20)
- 编译报错了啊,哥哥 HOT 1
- [email protected]版本bug HOT 1
- 公告:1.13.4 的问题说明 HOT 15
- AssignmentPattern 的情况是否应该考虑一下?
- HELP!!! how i can use this in rollup!!!
- 使用yalc开发组件库,工程不能随时更新
- When using the plugin, I got warnings on Netlify about "Conflicting order. Following module has been added:"
- add LICENSE.md
- 只想要import样式文件,能不能不要帮我处理js文件? HOT 1
- 是我配置的姿势不对吗,毛用都没有 HOT 1
- unable to resolve dependency tree
- babel-plugin-import 对 ts语法 ( Com as any ) 和 带装饰器的 class extends Com 支持有问题 HOT 1
- babel-plugin-import与babel-plugin-istanbul冲突
- plugin 中 第三个参数作用
- 不知道为什么打包后会有引入node_modules/antd/es/index.js的代码 HOT 1
- 局部变量和 import 重名 插件转换有问题
- ImportDeclaration(path, state){} 监听 可以会比 CallExpression(path, state) {} 监听 后执行。
- 使用了thread-loader后,customName配置项失效
- 1.13.7 驼峰转换有问题,导致构建报错找不到组件 HOT 1
- 命名转换方法导致其他组件报错的问题。 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from babel-plugin-import.