Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
ant-design-pro
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
duanledexianxianxian
ant-design-pro
Commits
8f4c3f6f
Commit
8f4c3f6f
authored
Aug 14, 2018
by
陈帅
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix change theme plugin
parent
56dba6c0
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
47 additions
and
41 deletions
+47
-41
config/config.js
config/config.js
+16
-41
config/plugin.config.js
config/plugin.config.js
+31
-0
No files found.
config/config.js
View file @
8f4c3f6f
...
@@ -2,28 +2,27 @@
...
@@ -2,28 +2,27 @@
// https://umijs.org/config/
// https://umijs.org/config/
const
pageRoutes
=
require
(
'
./router.config
'
);
const
pageRoutes
=
require
(
'
./router.config
'
);
const
webpackplugin
=
require
(
'
./plugin.config
'
);
const
path
=
require
(
'
path
'
);
const
path
=
require
(
'
path
'
);
export
default
{
export
default
{
// add for transfer to umi
// add for transfer to umi
plugins
:
[
plugins
:
[
[
'
umi-plugin-react
'
,
{
[
antd
:
true
,
'
umi-plugin-react
'
,
dva
:
{
{
hmr
:
true
,
antd
:
true
,
},
dva
:
{
locale
:
{
hmr
:
true
,
enable
:
true
,
// default false
},
default
:
'
zh-CN
'
,
// default zh-CN
locale
:
{
baseNavigator
:
true
,
// default true, when it is true, will use `navigator.language` overwrite default
enable
:
true
,
// default false
default
:
'
zh-CN
'
,
// default zh-CN
baseNavigator
:
true
,
// default true, when it is true, will use `navigator.language` overwrite default
},
dll
:
[
'
dva
'
,
'
dva/router
'
,
'
dva/saga
'
,
'
dva/fetch
'
],
},
},
dll
:
[
],
'
dva
'
,
'
dva/router
'
,
'
dva/saga
'
,
'
dva/fetch
'
,
],
}],
],
],
// 路由配置
// 路由配置
routes
:
pageRoutes
,
routes
:
pageRoutes
,
...
@@ -82,29 +81,5 @@ export default {
...
@@ -82,29 +81,5 @@ export default {
],
],
},
},
chainWebpack
(
config
)
{
chainWebpack
:
webpackplugin
,
const
AntDesignThemePlugin
=
require
(
'
antd-theme-webpack-plugin
'
);
const
MergeLessPlugin
=
require
(
'
antd-pro-merge-less
'
);
// 将所有 less 合并为一个供 themePlugin使用
const
outFile
=
path
.
join
(
__dirname
,
'
./.temp/ant-design-pro.less
'
);
const
stylesDir
=
path
.
join
(
__dirname
,
'
./src/
'
);
// config
// .plugin('merge-less')
// .use(MergeLessPlugin, [{
// stylesDir,
// outFile,
// }]);
// config
// .plugin('ant-design-theme')
// .use(AntDesignThemePlugin, [{
// antDir: path.join(__dirname, './node_modules/antd'),
// stylesDir,
// varFile: path.join(__dirname, './node_modules/antd/lib/style/themes/default.less'),
// mainLessFile: outFile,
// themeVariables: ['@primary-color'],
// indexFileName: 'index.html',
// }]);
},
};
};
config/plugin.config.js
0 → 100644
View file @
8f4c3f6f
// Change theme plugin
const
MergeLessPlugin
=
require
(
'
antd-pro-merge-less
'
);
const
AntDesignThemePlugin
=
require
(
'
antd-theme-webpack-plugin
'
);
const
path
=
require
(
'
path
'
);
const
plugin
=
config
=>
{
// 将所有 less 合并为一个供 themePlugin使用
const
outFile
=
path
.
join
(
__dirname
,
'
../.temp/ant-design-pro.less
'
);
const
stylesDir
=
path
.
join
(
__dirname
,
'
../src/
'
);
config
.
plugin
(
'
merge-less
'
).
use
(
MergeLessPlugin
,
[
{
stylesDir
,
outFile
,
},
]);
config
.
plugin
(
'
ant-design-theme
'
).
use
(
AntDesignThemePlugin
,
[
{
antDir
:
path
.
join
(
__dirname
,
'
../node_modules/antd
'
),
stylesDir
,
varFile
:
path
.
join
(
__dirname
,
'
../node_modules/antd/lib/style/themes/default.less
'
),
mainLessFile
:
outFile
,
themeVariables
:
[
'
@primary-color
'
],
indexFileName
:
'
index.html
'
,
},
]);
};
module
.
exports
=
plugin
;
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment