Open callmez opened 6 years ago
配置贴出来看下。
找到问题了是 babelPlugins报错, 用了antd, 和antd-mobile 在1的时候不会报错
{
"entry": "src/pages/*.js",
"outputPath": "../public",
"extraBabelPlugins": [
"transform-decorators-legacy",
[
"import", [
{ "libraryName": "antd", "libraryDirectory": "es", "style": true },
{ "libraryName": "antd-mobile", "libraryDirectory": "lib", "style": true }
]
]
],
"env": {
"development": {
"extraBabelPlugins": [
"dva-hmr"
]
}
},
"ignoreMomentLocale": true,
"theme": "./src/theme.js",
"html": {
"template": "./src/index.ejs"
},
"hash": true
}
请问在2里如何同时引用 antd和ant-mobile
写两个 ['import', {}]
,babel@7 不支持数组格式的 option 了。
已解决, 但是有还有个问题就是 cli里显示的错误信息要不是不完全. 要不就会被截断看不到完整的错误信息. 这块的体验还请加强
恩,这个 issue 先开着,我找时间完善下。
贴个可以用的配置, 重复使用插件需要 加个 unique name
,
{
"entry": "src/pages/*.js",
"outputPath": "../public",
"extraBabelPlugins": [
"transform-decorators-legacy",
["import", { "libraryName": "antd", "libraryDirectory": "es", "style": true }],
["import", { "libraryName": "antd-mobile", "libraryDirectory": "lib", "style": true }, "ant-mobile"]
],
"env": {
"development": {
"extraBabelPlugins": [
"dva-hmr"
]
}
},
"ignoreMomentLocale": true,
"theme": "./src/theme.js",
"html": {
"template": "./src/index.ejs"
},
"hash": true
}
在升级到2.0的时候 出现了以下错误
虽然报错但是没有详细的错误信息 而且很难定位信息....无从下手