akfun 5.0.2 → 5.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "akfun",
3
- "version": "5.0.2",
3
+ "version": "5.1.0",
4
4
  "description": "前端脚手架:支持Vue技术栈和react技术栈",
5
5
  "keywords": [
6
6
  "前端工程",
@@ -60,9 +60,10 @@
60
60
  "@babel/plugin-proposal-numeric-separator": "^7.16.7",
61
61
  "@babel/plugin-proposal-throw-expressions": "^7.16.7",
62
62
  "@babel/plugin-syntax-dynamic-import": "^7.8.3",
63
- "@babel/plugin-syntax-import-meta": "^7.10.4",
63
+ "@babel/plugin-syntax-import-meta": "^7.27.1",
64
64
  "@babel/plugin-transform-runtime": "^7.17.0",
65
65
  "@babel/polyfill": "^7.10.1",
66
+ "@babel/runtime": "^7.27.1",
66
67
  "@babel/preset-env": "^7.16.11",
67
68
  "@babel/preset-react": "^7.16.7",
68
69
  "@babel/preset-typescript": "^7.16.7",
package/src/dev-server.js CHANGED
@@ -50,6 +50,23 @@ module.exports = function (akfunConfig, _consoleTag) {
50
50
  // 获取开发环境的webpack基本配置
51
51
  const webpackConfig = getDevWebpackConfig(config);
52
52
 
53
+ // Define HTTP proxies to your custom API backend
54
+ // https://github.com/chimurai/http-proxy-middleware
55
+ // 使用 config.dev.proxyTable 的配置作为 proxyTable 的代理配置
56
+ // 备注:需放connect-history-api-fallback前面,避免get请求的代理失效
57
+ const proxyTable = config.dev.proxyTable;
58
+ if (proxyTable && JSON.stringify(proxyTable) !== '{}') {
59
+ // 将 proxyTable 中的请求配置挂在到启动的 express 服务上
60
+ // proxy api requests
61
+ Object.keys(proxyTable).forEach((context) => {
62
+ let options = proxyTable[context];
63
+ if (typeof options === 'string') {
64
+ options = { target: options };
65
+ }
66
+ app.use(context, createProxyMiddleware(options));
67
+ });
68
+ }
69
+
53
70
  // 使用 connect-history-api-fallback 匹配资源,如果不匹配就可以重定向到指定地址
54
71
  // handle fallback for HTML5 history API
55
72
  // 备注:需放express.static前面,避免失效
@@ -81,22 +98,6 @@ module.exports = function (akfunConfig, _consoleTag) {
81
98
  // compilation error display
82
99
  app.use(hotMiddleware);
83
100
 
84
- // Define HTTP proxies to your custom API backend
85
- // https://github.com/chimurai/http-proxy-middleware
86
- // 使用 config.dev.proxyTable 的配置作为 proxyTable 的代理配置
87
- const proxyTable = config.dev.proxyTable;
88
- if (proxyTable && JSON.stringify(proxyTable) !== '{}') {
89
- // 将 proxyTable 中的请求配置挂在到启动的 express 服务上
90
- // proxy api requests
91
- Object.keys(proxyTable).forEach((context) => {
92
- let options = proxyTable[context];
93
- if (typeof options === 'string') {
94
- options = { target: options };
95
- }
96
- app.use(context, createProxyMiddleware(options));
97
- });
98
- }
99
-
100
101
  const afterCreateServerAction = (isHttps, port) => {
101
102
  spinner.succeed(`${consoleTag}调试模式已开启!`);
102
103
 
@@ -1,47 +0,0 @@
1
- # Numerous always-ignore extensions
2
- *.bak
3
- *.patch
4
- *.diff
5
- *.err
6
-
7
- # temp file for git conflict merging
8
- *.orig
9
- *.log
10
- *.rej
11
- *.swo
12
- *.swp
13
- *.zip
14
- *.vi
15
- *~
16
- *.sass-cache
17
- *.tmp.html
18
- *.dump
19
-
20
- # OS or Editor folders
21
- .DS_Store
22
- ._*
23
- .cache
24
- .project
25
- .settings
26
- .tmproj
27
- *.esproj
28
- *.sublime-project
29
- *.sublime-workspace
30
- nbproject
31
- thumbs.db
32
- *.iml
33
- .vscode/
34
-
35
- # Folders to ignore
36
- .hg
37
- .svn
38
- .CVS
39
- .idea
40
- node_modules/
41
- jscoverage_lib/
42
- .svn
43
-
44
- # log files
45
- npm-debug.log*
46
- yarn-debug.log*
47
- yarn-error.log*