Bläddra i källkod

feat: update config file with es6

愚道 7 år sedan
förälder
incheckning
ef3653a8a8
3 ändrade filer med 9 tillägg och 11 borttagningar
  1. 4 4
      config/config.js
  2. 4 6
      config/plugin.config.js
  3. 1 1
      config/router.config.js

+ 4 - 4
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

+ 4 - 6
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;

+ 1 - 1
config/router.config.js

@@ -1,4 +1,4 @@
-module.exports = [
+export default [
   // user
   {
     path: '/user',