Comments (6)
在webpack.config中加入
babel: {
"plugins": [["antd"]]
}
from babel-plugin-import.
以下是我这边的config,可以参考下
var webpack = require('webpack');
module.exports = {
entry: [
'webpack/hot/only-dev-server',
"./js/app.js"
],
output: {
path: './build',
filename: "bundle.js"
},
module: {
loaders: [
{ test: /.js$/, exclude: /node_modules/, loader: 'babel-loader'},
{ test: /.css$/, loader: "style!css" },
{test: /.less/,loader: 'style-loader!css-loader!less-loader'},
{
test: /.js$/,
exclude: /node_modules/,
loader: "babel-loader",
query:
{
presets:['react','es2015']
}
}
]
},
resolve:{
extensions:['','.js','.json']
},
devServer: {
hot: true,
inline: true
},
plugins: [
new webpack.NoErrorsPlugin(),
new webpack.HotModuleReplacementPlugin()
],
babel: {
"plugins": [["antd"]]
}
};
from babel-plugin-import.
@jiushiwoyuze 有完整的webpack.config文件吗?
from babel-plugin-import.
@jiushiwoyuze 我试了一下 还是不行
from babel-plugin-import.
反馈问题的时候最好说明下自己的平台,node 的版本,npm 版本,自己引入的 webpack 的版本。
另外为了我们能更好的阅读你反馈的问题也建议你至少格式化你贴的代码。
至于配置如何写,可以参考
https://github.com/ant-tool/atool-build/blob/master/src/getWebpackCommonConfig.js#L44
from babel-plugin-import.
OK了,多谢啦
from babel-plugin-import.
Related Issues (20)
- [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
- lodash 使用冲突问题
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.