From 9a8ea3f27c46af497e3f46e53609ae5291e423cd Mon Sep 17 00:00:00 2001 From: chencheng Date: Tue, 9 Jan 2018 17:58:40 +0800 Subject: [PATCH] code style --- packages/umi-build-dev/src/getRouterContent.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/packages/umi-build-dev/src/getRouterContent.js b/packages/umi-build-dev/src/getRouterContent.js index 666628124472..32a81282c4a2 100644 --- a/packages/umi-build-dev/src/getRouterContent.js +++ b/packages/umi-build-dev/src/getRouterContent.js @@ -34,7 +34,7 @@ function getRouteComponents(routeConfig, config = {}, paths) { const { loading } = config; let loadingOpts = ''; if (loading) { - loadingOpts = `loading: require('${join(paths.cwd, loading)}').default,`; + loadingOpts = `, loading: require('${join(paths.cwd, loading)}').default,`; } const routerComponents = Object.keys(routeConfig).map(key => { @@ -46,9 +46,13 @@ function getRouteComponents(routeConfig, config = {}, paths) { : '() =>
Compiling...
'; return ` `; } else { - return ` import(/* webpackChunkName: '${normalizeEntry( + return ` import(/* webpackChunkName: '${normalizeEntry( routeConfig[key], - )}' */'${pageJSFile}'), { callback: (err) => callback('${key}', err), ${loadingOpts} }) }>`; + )}' */'${pageJSFile}'), { callback: (err) => callback('${key}', err)${ + loadingOpts + } }) }>`; } });