|
| 1 | +/** Created by Umi Plugin **/ |
| 2 | + |
| 3 | +export interface IConfigFromPlugins { |
| 4 | + routes?: { |
| 5 | + /** |
| 6 | + * Any valid URL path |
| 7 | + */ |
| 8 | + path?: string; |
| 9 | + /** |
| 10 | + * A React component to render only when the location matches. |
| 11 | + */ |
| 12 | + component?: string | (() => any); |
| 13 | + wrappers?: string[]; |
| 14 | + /** |
| 15 | + * navigate to a new location |
| 16 | + */ |
| 17 | + redirect?: string; |
| 18 | + /** |
| 19 | + * When true, the active class/style will only be applied if the location is matched exactly. |
| 20 | + */ |
| 21 | + exact?: boolean; |
| 22 | + routes?: any[]; |
| 23 | + [k: string]: any; |
| 24 | + }[]; |
| 25 | + history?: { |
| 26 | + type?: "browser" | "hash" | "memory"; |
| 27 | + options?: {}; |
| 28 | + }; |
| 29 | + polyfill?: { |
| 30 | + imports?: string[]; |
| 31 | + }; |
| 32 | + alias?: {}; |
| 33 | + analyze?: { |
| 34 | + analyzerMode?: "server" | "static" | "disabled"; |
| 35 | + analyzerHost?: string; |
| 36 | + analyzerPort?: any; |
| 37 | + openAnalyzer?: boolean; |
| 38 | + generateStatsFile?: boolean; |
| 39 | + statsFilename?: string; |
| 40 | + logLevel?: "info" | "warn" | "error" | "silent"; |
| 41 | + defaultSizes?: "stat" | "parsed" | "gzip"; |
| 42 | + [k: string]: any; |
| 43 | + }; |
| 44 | + /** |
| 45 | + * postcss autoprefixer, default flexbox: no-2009 |
| 46 | + */ |
| 47 | + autoprefixer?: {}; |
| 48 | + base?: string; |
| 49 | + chainWebpack?: () => any; |
| 50 | + chunks?: string[]; |
| 51 | + /** |
| 52 | + * more css-loader options see https://webpack.js.org/loaders/css-loader/#options |
| 53 | + */ |
| 54 | + cssLoader?: { |
| 55 | + url?: boolean | (() => any); |
| 56 | + import?: boolean | (() => any); |
| 57 | + modules?: boolean | string | {}; |
| 58 | + sourceMap?: boolean; |
| 59 | + importLoaders?: number; |
| 60 | + onlyLocals?: boolean; |
| 61 | + esModule?: boolean; |
| 62 | + localsConvention?: "asIs" | "camelCase" | "camelCaseOnly" | "dashes" | "dashesOnly"; |
| 63 | + }; |
| 64 | + cssModulesTypescriptLoader?: { |
| 65 | + mode?: "emit" | "verify"; |
| 66 | + }; |
| 67 | + cssnano?: {}; |
| 68 | + copy?: string[]; |
| 69 | + define?: {}; |
| 70 | + devScripts?: {}; |
| 71 | + /** |
| 72 | + * devServer configs |
| 73 | + */ |
| 74 | + devServer?: { |
| 75 | + /** |
| 76 | + * devServer port, default 8000 |
| 77 | + */ |
| 78 | + port?: number; |
| 79 | + host?: string; |
| 80 | + https?: |
| 81 | + | { |
| 82 | + key?: string; |
| 83 | + cert?: string; |
| 84 | + [k: string]: any; |
| 85 | + } |
| 86 | + | boolean; |
| 87 | + headers?: {}; |
| 88 | + writeToDisk?: boolean | (() => any); |
| 89 | + [k: string]: any; |
| 90 | + }; |
| 91 | + devtool?: string; |
| 92 | + /** |
| 93 | + * Code splitting for performance optimization |
| 94 | + */ |
| 95 | + dynamicImport?: { |
| 96 | + /** |
| 97 | + * loading the component before loaded |
| 98 | + */ |
| 99 | + loading?: string; |
| 100 | + }; |
| 101 | + exportStatic?: { |
| 102 | + htmlSuffix?: boolean; |
| 103 | + dynamicRoot?: boolean; |
| 104 | + /** |
| 105 | + * extra render paths only enable in ssr |
| 106 | + */ |
| 107 | + extraRoutePaths?: () => any; |
| 108 | + }; |
| 109 | + externals?: {} | string | (() => any); |
| 110 | + extraBabelPlugins?: any[]; |
| 111 | + extraBabelPresets?: any[]; |
| 112 | + extraPostCSSPlugins?: any[]; |
| 113 | + /** |
| 114 | + * More options see https://www.npmjs.com/package/fork-ts-checker-webpack-plugin#options |
| 115 | + */ |
| 116 | + forkTSChecker?: { |
| 117 | + /** |
| 118 | + * Path to tsconfig.json file |
| 119 | + */ |
| 120 | + tsconfig?: string; |
| 121 | + /** |
| 122 | + * Allows overriding TypeScript options. Should be specified in the same format as you would do for the compilerOptions property in tsconfig.json. |
| 123 | + */ |
| 124 | + compilerOptions?: {}; |
| 125 | + eslint?: boolean; |
| 126 | + eslintOptions?: {}; |
| 127 | + async?: boolean; |
| 128 | + ignoreDiagnostics?: number[]; |
| 129 | + formatter?: any; |
| 130 | + formatterOptions?: {}; |
| 131 | + silent?: boolean; |
| 132 | + checkSyntacticErrors?: boolean; |
| 133 | + }; |
| 134 | + hash?: boolean; |
| 135 | + ignoreMomentLocale?: boolean; |
| 136 | + inlineLimit?: number; |
| 137 | + lessLoader?: {}; |
| 138 | + manifest?: { |
| 139 | + fileName?: string; |
| 140 | + publicPath?: string; |
| 141 | + basePath?: string; |
| 142 | + writeToFileEmit?: boolean; |
| 143 | + }; |
| 144 | + mountElementId?: ""; |
| 145 | + mpa?: {}; |
| 146 | + nodeModulesTransform?: { |
| 147 | + type?: "all" | "none"; |
| 148 | + exclude?: string[]; |
| 149 | + }; |
| 150 | + outputPath?: ""; |
| 151 | + plugins?: string[]; |
| 152 | + postcssLoader?: {}; |
| 153 | + presets?: string[]; |
| 154 | + proxy?: {}; |
| 155 | + publicPath?: string; |
| 156 | + runtimePublicPath?: boolean; |
| 157 | + ssr?: { |
| 158 | + /** |
| 159 | + * remove window.g_initialProps in html, to force execing Page getInitialProps functions |
| 160 | + */ |
| 161 | + forceInitial?: boolean; |
| 162 | + /** |
| 163 | + * disable serve-side render in umi dev mode. |
| 164 | + */ |
| 165 | + devServerRender?: boolean; |
| 166 | + mode?: "stream" | "string"; |
| 167 | + /** |
| 168 | + * static markup in static site |
| 169 | + */ |
| 170 | + staticMarkup?: boolean; |
| 171 | + }; |
| 172 | + singular?: boolean; |
| 173 | + styleLoader?: {}; |
| 174 | + targets?: {}; |
| 175 | + terserOptions?: {}; |
| 176 | + theme?: {}; |
| 177 | + favicon?: string; |
| 178 | + headScripts?: any[]; |
| 179 | + links?: any[]; |
| 180 | + metas?: any[]; |
| 181 | + scripts?: any[]; |
| 182 | + styles?: any[]; |
| 183 | + title?: string; |
| 184 | + mock?: { |
| 185 | + exclude?: string[]; |
| 186 | + }; |
| 187 | + themeConfig?: {}; |
| 188 | + logo?: string | boolean; |
| 189 | + mode?: any; |
| 190 | + description?: string; |
| 191 | + locales?: string[][]; |
| 192 | + resolve?: {}; |
| 193 | + menus?: {}; |
| 194 | + navs?: any[] | {}; |
| 195 | + algolia?: { |
| 196 | + apiKey?: string; |
| 197 | + indexName?: string; |
| 198 | + debug?: boolean; |
| 199 | + }; |
| 200 | + sitemap?: { |
| 201 | + hostname?: string; |
| 202 | + excludes?: string[]; |
| 203 | + }; |
| 204 | + [k: string]: any; |
| 205 | +} |
0 commit comments