Skip to content

Commit 536b0f1

Browse files
committed
fix: 修改构建配置
1 parent f3bbd10 commit 536b0f1

13 files changed

Lines changed: 59679 additions & 1 deletion

File tree

.github/workflows/deploy.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
- name: Set Node Version
1717
uses: actions/setup-node@v3
1818
with:
19-
node-version: '18.20.2'
19+
node-version: '14.21.2'
2020
- name: Install and Build 🔧 # This example project is built using npm and outputs the result to the 'build' folder. Replace with the commands required to build your project, or remove this step entirely if your site is pre-built.
2121
run: |
2222
yarn install

.umi-production/core/history.ts

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
// @ts-nocheck
2+
import { createBrowserHistory } from '/Users/mrsingsing/mrsingsing/JavaScript-GuideBook/node_modules/@umijs/runtime';
3+
4+
let options = {
5+
"basename": "/javascript-guidebook/"
6+
};
7+
if ((<any>window).routerBase) {
8+
options.basename = (<any>window).routerBase;
9+
}
10+
11+
// remove initial history because of ssr
12+
let history: any = process.env.__IS_SERVER ? null : createBrowserHistory(options);
13+
export const createHistory = (hotReload = false) => {
14+
if (!hotReload) {
15+
history = createBrowserHistory(options);
16+
}
17+
18+
return history;
19+
};
20+
21+
// 通常仅微前端场景需要调用这个 API
22+
export const setCreateHistoryOptions = (newOpts: any = {}) => {
23+
options = { ...options, ...newOpts };
24+
};
25+
26+
export { history };

.umi-production/core/plugin.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
// @ts-nocheck
2+
import { Plugin } from '/Users/mrsingsing/mrsingsing/JavaScript-GuideBook/node_modules/@umijs/runtime';
3+
4+
const plugin = new Plugin({
5+
validKeys: ['patchRoutes','rootContainer','render','onRouteChange','ssr',],
6+
});
7+
plugin.register({
8+
apply: require('/Users/mrsingsing/mrsingsing/JavaScript-GuideBook/app.ts'),
9+
path: '/Users/mrsingsing/mrsingsing/JavaScript-GuideBook/app.ts',
10+
});
11+
12+
export { plugin };
Lines changed: 205 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,205 @@
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+
}

.umi-production/core/polyfill.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
// @ts-nocheck
2+
import 'core-js';
3+
import 'regenerator-runtime/runtime';

0 commit comments

Comments
 (0)