From ef3653a8a830aff702c8b963b1d45b58968c015a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=84=9A=E9=81=93?= Date: Fri, 31 Aug 2018 11:19:34 +0800 Subject: [PATCH] feat: update config file with es6 --- config/config.js | 8 ++++---- config/plugin.config.js | 10 ++++------ config/router.config.js | 2 +- 3 files changed, 9 insertions(+), 11 deletions(-) diff --git a/config/config.js b/config/config.js index b73a21df..e2aea968 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 aa7cb717..20e1ca5f 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 346a36bb..87b1b39d 100644 --- a/config/router.config.js +++ b/config/router.config.js @@ -1,4 +1,4 @@ -module.exports = [ +export default [ // user { path: '/user', -- GitLab