diff --git a/config/config.js b/config/config.js index b73a21dfb08bca6fc423c4d9efaf7aeb5aa235f4..e2aea968c8cb3987eb0e83013f4d60af929ceea2 100644 --- a/config/config.js +++ b/config/config.js @@ -1,8 +1,8 @@ // https://umijs.org/config/ -const os = require('os'); -const pageRoutes = require('./router.config'); -const webpackplugin = require('./plugin.config'); -const defaultSettings = require('../src/defaultSettings'); +import os from 'os'; +import pageRoutes from './router.config'; +import webpackplugin from './plugin.config'; +import defaultSettings from '../src/defaultSettings'; export default { // add for transfer to umi diff --git a/config/plugin.config.js b/config/plugin.config.js index aa7cb717da65296cd0bf454bfef5b828c649c8ef..20e1ca5f3a7467eae3e2ecd1b260c2b3ebf1c359 100644 --- a/config/plugin.config.js +++ b/config/plugin.config.js @@ -1,10 +1,10 @@ // Change theme plugin -const MergeLessPlugin = require('antd-pro-merge-less'); -const AntDesignThemePlugin = require('antd-pro-theme-webpack-plugin'); -const path = require('path'); +import MergeLessPlugin from 'antd-pro-merge-less'; +import AntDesignThemePlugin from 'antd-pro-theme-webpack-plugin'; +import path from 'path'; -const plugin = config => { +export default config => { // 将所有 less 合并为一个供 themePlugin使用 const outFile = path.join(__dirname, '../.temp/ant-design-pro.less'); const stylesDir = path.join(__dirname, '../src/'); @@ -26,5 +26,3 @@ const plugin = config => { }, ]); }; - -module.exports = plugin; diff --git a/config/router.config.js b/config/router.config.js index 346a36bbc2798b19a242dee0202dfff956029348..87b1b39d077b08b49eae6a994f8713bab39c623d 100644 --- a/config/router.config.js +++ b/config/router.config.js @@ -1,4 +1,4 @@ -module.exports = [ +export default [ // user { path: '/user',