Dva: webpack引入andt样式配置报错

Created on 11 Jan 2017  ·  4Comments  ·  Source: dvajs/dva

webpack.config.js中加入
webpackConfig.babel.plugins.push(['import', { libraryName: 'antd', style: 'css' // if true, use less }]);
然后npm start,就报如下错误:
ERROR in ./src/index.js Module build failed: ReferenceError: Unknown plugin "import" specified in "base" at 3, attempted to resolve relative to "F:\\Project\\AccountSystem\\src" at F:\Project\AccountSystem\node_modules\babel-core\lib\transformation\file\options\option-manager.js:176:17 at Array.map (native) at Function.normalisePlugins (F:\Project\AccountSystem\node_modules\babel-core\lib\transformation\file\options\option-manager.js:154:20) at OptionManager.mergeOptions (F:\Project\AccountSystem\node_modules\babel-core\lib\transformation\file\options\option-manager.js:229:36) at OptionManager.init (F:\Project\AccountSystem\node_modules\babel-core\lib\transformation\file\options\option-manager.js:374:12) at File.initOptions (F:\Project\AccountSystem\node_modules\babel-core\lib\transformation\file\index.js:216:65) at new File (F:\Project\AccountSystem\node_modules\babel-core\lib\transformation\file\index.js:139:24) at Pipeline.transform (F:\Project\AccountSystem\node_modules\babel-core\lib\transformation\pipeline.js:46:16) at transpile (F:\Project\AccountSystem\node_modules\babel-loader\lib\index.js:38:20) at F:\Project\AccountSystem\node_modules\babel-loader\lib\fs-cache.js:78:18 @ multi index

question

Most helpful comment

不会。参考这里第二步,https://github.com/sorrycc/blog/issues/18

All 4 comments

没安装 babel-plugin-import 的依赖?

是默认直接安装的dva,默认不会安装这个依赖嘛,安装之后就好了,非常感谢!!

不会。参考这里第二步,https://github.com/sorrycc/blog/issues/18

嗯,ok了,感谢!

Was this page helpful?
0 / 5 - 0 ratings