Skip to content

Commit b3d0ef5

Browse files
committed
chore: improve doc build speed
1 parent 443e8c2 commit b3d0ef5

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

.umirc.ts

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,8 @@ function getMenus(opts: { lang?: string; base: '/docs' | '/plugins' }) {
102102
});
103103
}
104104

105+
const isDev = process.env.NODE_ENV === 'development';
106+
105107
export default {
106108
favicon: 'https://img.alicdn.com/tfs/TB1YHEpwUT1gK0jSZFhXXaAtVXa-28-27.svg',
107109
mode: 'site',
@@ -127,8 +129,15 @@ export default {
127129
path: 'https://github.com/umijs/umi',
128130
},
129131
],
130-
exportStatic: {},
131-
analytics: {
132-
ga: 'UA-149864185-1',
132+
polyfill: false,
133+
nodeModulesTransform: {
134+
type: 'none',
133135
},
136+
exportStatic: {},
137+
dynamicImport: {},
138+
analytics: isDev
139+
? false
140+
: {
141+
ga: 'UA-149864185-1',
142+
},
134143
};

packages/core/src/Route/routesToJSON.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ export default function ({ routes, config, cwd }: IOpts) {
3434
.replace(/\.jsx?$/, '')
3535
.replace(/\.tsx?$/, '')
3636
.replace(/^src__/, '')
37+
.replace(/\.\.__/g, '')
3738
// 约定式路由的 [ 会导致 webpack 的 code splitting 失败
3839
// ref: https://github.com/umijs/umi/issues/4155
3940
.replace(/[\[\]]/g, '')

0 commit comments

Comments
 (0)