mm_statics 1.8.4 → 1.8.6

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.
Files changed (2) hide show
  1. package/index.js +27 -27
  2. package/package.json +8 -8
package/index.js CHANGED
@@ -182,31 +182,31 @@ Static.prototype._formatCode = async function (code, file_type) {
182
182
  }
183
183
  };
184
184
 
185
- /**
186
- * 处理require模块语句
187
- * @param {string} script 包含require语句的代码
188
- * @returns {string|null} 处理后的代码或null
189
- */
190
- Static.prototype._requireMod = function (script) {
191
- if (script) {
192
- var src = script.between('[', ']');
193
- var imports = src;
194
- var arr = imports.split(',');
195
- var len = arr.length;
196
- for (var i = 0; i < len; i++) {
197
- var s = arr[i];
198
- if (s.endsWith('.vue"')) {
199
- imports = imports.replace(s, '"vue!' + s.trim().trim('"') + '"');
200
- } else if (s.endsWith('.css"')) {
201
- imports = imports.replace(s, '"css!' + s.trim().trim('"') + '"');
202
- } else if (s.endsWith('.html"')) {
203
- imports = imports.replace(s, '"text!' + s.trim().trim('"') + '"');
204
- }
205
- }
206
- return script.replace(src, imports);
207
- }
208
- return null;
209
- };
185
+ // /**
186
+ // * 处理require模块语句
187
+ // * @param {string} script 包含require语句的代码
188
+ // * @returns {string|null} 处理后的代码或null
189
+ // */
190
+ // Static.prototype._requireMod = function (script) {
191
+ // if (script) {
192
+ // var src = script.between('[', ']');
193
+ // var imports = src;
194
+ // var arr = imports.split(',');
195
+ // var len = arr.length;
196
+ // for (var i = 0; i < len; i++) {
197
+ // var s = arr[i];
198
+ // if (s.endsWith('.vue"')) {
199
+ // imports = imports.replace(s, '"vue!' + s.trim().trim('"') + '"');
200
+ // } else if (s.endsWith('.css"')) {
201
+ // imports = imports.replace(s, '"css!' + s.trim().trim('"') + '"');
202
+ // } else if (s.endsWith('.html"')) {
203
+ // imports = imports.replace(s, '"text!' + s.trim().trim('"') + '"');
204
+ // }
205
+ // }
206
+ // return script.replace(src, imports);
207
+ // }
208
+ // return null;
209
+ // };
210
210
 
211
211
  /**
212
212
  * 转换为AMD模块
@@ -221,7 +221,7 @@ Static.prototype._toAmd = async function (file_type, text) {
221
221
  if (this._isEs6Code(txt)) {
222
222
  let code = this.convert.toAmd(txt);
223
223
  // 处理require模块语句
224
- code = this._requireMod(code);
224
+ // code = this._requireMod(code);
225
225
  // 添加return语句确保AMD模块正确导出
226
226
  // code = this._addAmdReturn(code);
227
227
  // 格式化代码
@@ -243,7 +243,7 @@ Static.prototype._toAmd = async function (file_type, text) {
243
243
  if (this._isEs6Code(inner_code)) {
244
244
  let amd_code = this.convert.toAmd(inner_code);
245
245
  // 处理require模块语句
246
- amd_code = this._requireMod(amd_code);
246
+ // amd_code = this._requireMod(amd_code);
247
247
  // // 添加return语句确保AMD模块正确导出
248
248
  // amd_code = this._addAmdReturn(amd_code);
249
249
  // 移除type="module"属性,因为AMD模块不需要这个属性
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mm_statics",
3
- "version": "1.8.4",
3
+ "version": "1.8.6",
4
4
  "description": "这是超级美眉statics函数模块,用于web服务端statics缓存",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -37,19 +37,19 @@
37
37
  "static/"
38
38
  ],
39
39
  "dependencies": {
40
- "@vue/compiler-sfc": "^3.5.34",
40
+ "@vue/compiler-sfc": "^3.5.38",
41
41
  "abstract-syntax-tree": "^2.22.0",
42
42
  "chokidar": "^5.0.0",
43
43
  "koa-send": "^5.0.1",
44
- "marked": "^18.0.4",
44
+ "marked": "^18.0.5",
45
45
  "mm_cache": "^1.4.9",
46
- "mm_es6_to_amd": "^1.5.4",
47
- "prettier": "^3.8.3"
46
+ "mm_es6_to_amd": "^1.5.6",
47
+ "prettier": "^3.8.4"
48
48
  },
49
49
  "devDependencies": {
50
- "eslint": "^10.4.0",
51
- "eslint-plugin-jsdoc": "^63.0.0",
52
- "mm_eslint": "^1.7.1",
50
+ "eslint": "^10.5.0",
51
+ "eslint-plugin-jsdoc": "^63.0.6",
52
+ "mm_eslint": "^1.7.5",
53
53
  "mocha": "^11.7.6",
54
54
  "supertest": "^7.2.2"
55
55
  }