Skip to content

Commit

Permalink
change addHTMLHeadScript sort
Browse files Browse the repository at this point in the history
  • Loading branch information
chenshuai2144 committed Nov 23, 2019
1 parent 498dd4f commit ee4ab84
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ export default function(
return serveStatic(themeTemp);
});

api.addHTMLHeadScript({
content: `window.umi_plugin_ant_themeVar = ${JSON.stringify(options.theme)}`,
});

// 编译完成之后
api.onBuildSuccess(() => {
api.log.pending('💄 build theme');
Expand All @@ -48,9 +52,6 @@ export default function(
)
.then(() => {
api.log.success('🎊 build theme success');
api.addHTMLHeadScript({
content: `window.umi_plugin_ant_themeVar = ${JSON.stringify(options.theme)}`,
});
})
.catch(e => {
console.log(e);
Expand Down Expand Up @@ -83,9 +84,6 @@ export default function(
},
)
.then(() => {
api.addHTMLHeadScript({
content: `window.umi_plugin_ant_themeVar = ${JSON.stringify(options.theme)}`,
});
api.log.success('🎊 build theme success');
})
.catch(e => {
Expand Down

0 comments on commit ee4ab84

Please sign in to comment.