阿里的版本更新太快...每次都有變化,累啊css
一.2017-10-24版本:和vue-cli相似,安裝後eject後,生成webpack.config.dev.js,webpack.config.pro.js文件; babel-plugin-import安裝實現antd組件按需加載(在webpack.config.dev.js,webpack.config.pro.js文件中修改:vue
{ test: /\.(js|jsx)$/, include: paths.appSrc, loader: require.resolve('babel-loader'), options: { // 後期本身添加plugin plugins: [ ['import', { libraryName: 'antd', style: 'css' }], ], // This is a feature of `babel-loader` for webpack (not Babel itself). // It enables caching results in ./node_modules/.cache/babel-loader/ // directory for faster rebuilds. cacheDirectory: true, },
)node
注意:1.react@16.0.0和react-dom@16.0.0版本沒法使用message方法,所以需將默認版本回退到@15.2.0穩定版react
2.react-router:此時最新版本已經是@4.0.0版,能夠降版本降至@2.0.0穩定版。webpack
(回退方法:直接安裝目標版本的插件)web