@qse/edu-scripts 1.14.2 → 1.14.3

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/CHANGELOG.md CHANGED
@@ -1,5 +1,14 @@
1
1
  # 更新日志
2
2
 
3
+ ## 1.14.3 (2024-01-03)
4
+
5
+ - fix: 修复 app.d.ts html 文件类型错误
6
+ - feat: override transformNodeModules 默认 true,并且 production 模式下也可生效
7
+
8
+ ## 1.14.2 (2023-10-11)
9
+
10
+ - fix: 修复声明文件缺失
11
+
3
12
  ## 1.14.1 (2023-10-11)
4
13
 
5
14
  - fix: esbuild 压缩 target 改成 es5
package/app.d.ts CHANGED
@@ -16,11 +16,6 @@ declare module '*.bmp' {
16
16
  export default src
17
17
  }
18
18
 
19
- declare module '*.html' {
20
- const src: string
21
- export default src
22
- }
23
-
24
19
  declare module '*.gif' {
25
20
  const src: string
26
21
  export default src
package/docs/faq.md CHANGED
@@ -97,3 +97,48 @@ export default (callback) => {
97
97
  <!-- 引入 @qsb/antd -->
98
98
  <script src="//www.zhidianbao.cn:8088/qsxxwapdev/edu-scripts/qsb-antd.min.js"></script>
99
99
  ```
100
+
101
+ ## 钉钉遇到页面打开白屏
102
+
103
+ 这种情况多半是链接中带了 hash,导致页面跳转失败。(复制出来可能是新的链接,但页面其实是老的并未跳转)
104
+
105
+ 将下面两段代码分别加入对应的文件中,必须保证其位置在所有 `script` 最前面
106
+
107
+ 原理: 将 hash 转存至 localStorage,跳转后再取出
108
+
109
+ ```html
110
+ <!-- index.html -->
111
+ <script>
112
+ ;(function () {
113
+ var searchString = location.search
114
+ if (!/(\?|&)S=/.test(searchString)) {
115
+ var randomHexString = Math.random().toString(32).substring(2)
116
+ searchString = searchString.substring(1)
117
+ searchString = '?S=' + randomHexString + (searchString.length > 0 ? '&' + searchString : '')
118
+ }
119
+ if (location.hash) {
120
+ localStorage.setItem('qse:H', location.hash)
121
+ }
122
+ var pathnameArr = location.pathname.split('/')
123
+ var pathname = pathnameArr.slice(0, -1).concat('index1.html').join('/')
124
+ var __tmp_URL = location.origin + pathname + searchString
125
+ history.replaceState(null, document.title, __tmp_URL)
126
+ location.reload()
127
+ })()
128
+ </script>
129
+ ```
130
+
131
+ ```html
132
+ <!-- index1.html -->
133
+ <script>
134
+ ;(function () {
135
+ var hash = localStorage.getItem('qse:H')
136
+ if (hash) {
137
+ localStorage.removeItem('qse:H')
138
+ hash = /^#/.test(hash) ? hash : '#' + hash
139
+ var url = location.origin + location.pathname + location.search + hash
140
+ history.replaceState(history.state, null, url)
141
+ }
142
+ })()
143
+ </script>
144
+ ```
@@ -82,9 +82,9 @@ module.exports = function getBabelConfig(opts = {}) {
82
82
  }
83
83
  ],
84
84
  ["@babel/plugin-proposal-decorators", { legacy: true }],
85
- ["@babel/plugin-proposal-class-properties", { loose: true }],
86
- ["@babel/plugin-proposal-private-methods", { loose: true }],
87
- ["@babel/plugin-proposal-private-property-in-object", { loose: true }],
85
+ ["@babel/plugin-transform-class-properties", { loose: true }],
86
+ ["@babel/plugin-transform-private-methods", { loose: true }],
87
+ ["@babel/plugin-transform-private-property-in-object", { loose: true }],
88
88
  [
89
89
  "import",
90
90
  { libraryName: "lodash", libraryDirectory: "", camel2DashComponentName: false },
@@ -187,7 +187,7 @@ module.exports = function getWebpackConfig(args, override) {
187
187
  exclude: /node_modules/,
188
188
  options: require("./babel")()
189
189
  },
190
- (override.transformNodeModules || isProd) && {
190
+ override.transformNodeModules && {
191
191
  test: /\.m?js$/,
192
192
  loader: "babel-loader",
193
193
  exclude: /@babel(?:\/|\\{1,2})runtime/,
@@ -37,7 +37,6 @@ export type Config = {
37
37
  /**
38
38
  * 编译 node_modules 下文件
39
39
  *
40
- * 仅在 development 环境下生效。production 一定会编译 node_modules
41
40
  * @default true
42
41
  */
43
42
  transformNodeModules?: boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@qse/edu-scripts",
3
- "version": "1.14.2",
3
+ "version": "1.14.3",
4
4
  "author": "Kinoko",
5
5
  "license": "MIT",
6
6
  "description": "教育工程化基础框架",
@@ -34,19 +34,19 @@
34
34
  "extends": "qsb-react"
35
35
  },
36
36
  "dependencies": {
37
- "@babel/core": "~7.18.13",
38
- "@babel/plugin-proposal-decorators": "~7.18.10",
39
- "@babel/plugin-transform-runtime": "~7.18.10",
40
- "@babel/preset-env": "~7.18.10",
41
- "@babel/preset-react": "~7.18.6",
42
- "@babel/preset-typescript": "~7.18.6",
43
- "@babel/register": "~7.18.0",
44
- "@babel/runtime": "~7.18.9",
37
+ "@babel/core": "~7.23.2",
38
+ "@babel/plugin-proposal-decorators": "~7.23.2",
39
+ "@babel/plugin-transform-runtime": "~7.23.2",
40
+ "@babel/preset-env": "~7.23.2",
41
+ "@babel/preset-react": "~7.22.15",
42
+ "@babel/preset-typescript": "~7.23.2",
43
+ "@babel/register": "~7.22.15",
44
+ "@babel/runtime": "~7.23.2",
45
45
  "@pmmmwh/react-refresh-webpack-plugin": "^0.5.10",
46
46
  "@qse/ssh-sftp": "^1.0.0",
47
47
  "@svgr/webpack": "^8.0.1",
48
- "babel-loader": "^8.3.0",
49
- "babel-plugin-import": "^1.13.6",
48
+ "babel-loader": "^9.1.3",
49
+ "babel-plugin-import": "^1.13.8",
50
50
  "case-sensitive-paths-webpack-plugin": "^2.4.0",
51
51
  "chalk": "^4.1.2",
52
52
  "chokidar": "^3.5.3",
@@ -67,9 +67,9 @@ module.exports = function getBabelConfig(opts = {}) {
67
67
  },
68
68
  ],
69
69
  ['@babel/plugin-proposal-decorators', { legacy: true }],
70
- ['@babel/plugin-proposal-class-properties', { loose: true }],
71
- ['@babel/plugin-proposal-private-methods', { loose: true }],
72
- ['@babel/plugin-proposal-private-property-in-object', { loose: true }],
70
+ ['@babel/plugin-transform-class-properties', { loose: true }],
71
+ ['@babel/plugin-transform-private-methods', { loose: true }],
72
+ ['@babel/plugin-transform-private-property-in-object', { loose: true }],
73
73
  [
74
74
  'import',
75
75
  { libraryName: 'lodash', libraryDirectory: '', camel2DashComponentName: false },
@@ -210,7 +210,7 @@ module.exports = function getWebpackConfig(args, override) {
210
210
  exclude: /node_modules/,
211
211
  options: require('./babel')(),
212
212
  },
213
- (override.transformNodeModules || isProd) && {
213
+ override.transformNodeModules && {
214
214
  test: /\.m?js$/,
215
215
  loader: 'babel-loader',
216
216
  exclude: /@babel(?:\/|\\{1,2})runtime/,
@@ -39,7 +39,6 @@ export type Config = {
39
39
  /**
40
40
  * 编译 node_modules 下文件
41
41
  *
42
- * 仅在 development 环境下生效。production 一定会编译 node_modules
43
42
  * @default true
44
43
  */
45
44
  transformNodeModules?: boolean