@oipage/cli 0.3.0-alpha.3 → 0.3.0-alpha.5

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 CHANGED
@@ -32,6 +32,7 @@ v0.3.0:
32
32
  * 文件扩展名提取可能抛出 TypeError 问题
33
33
  * 路径匹配添加更多兼容,防止意外错误
34
34
  * 修复对文件夹判断未考虑符号链接指向的目录问题导致import语句解析出错问题
35
+ * 兼容 "@oipage/browser.js" 类似的包
35
36
  2、修复错误读取导致服务器奔溃问题
36
37
  3、对于二进制文件,采用流式传输
37
38
  - 优化改造
@@ -14,7 +14,7 @@ module.exports = function (basePath, filePath, entry, intercept, isDownload, isW
14
14
  if (/^[./]/.test(_importUrl)) {
15
15
  return _importCode;
16
16
  } else {
17
- return _importCode.replace(_importUrl, _importUrl.replace(/([^/])+/s, function (npmName) {
17
+ return _importCode.replace(_importUrl, _importUrl.replace(/((@[^/]+\/){0,1}[^/])+/s, function (npmName) {
18
18
 
19
19
  if (testIntercept(npmName, intercept)) {
20
20
  return (isWebsite ? "/@website/@modules/" : "/@modules/") + npmName;
@@ -31,7 +31,11 @@ module.exports = function (basePath, filePath, entry, intercept, isDownload, isW
31
31
 
32
32
  // 对于类似 import VISLite from "vislite"
33
33
  // 需要把包名解析成具体的文件
34
- if (!/\//.test(_importUrl)) {
34
+ if (!/\//.test(_importUrl
35
+
36
+ // 兼容 "@oipage/browser.js" 类似的包
37
+ // 2026年09月11日 于南宁
38
+ .replace(/@[^/]+\//, ""))) {
35
39
  let bundlePackage = require(join(npmBundlePath, "./package.json"));
36
40
  npmNameValue = npmName + "/" + bundlePackage.main;
37
41
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oipage/cli",
3
- "version": "0.3.0-alpha.3",
3
+ "version": "0.3.0-alpha.5",
4
4
  "description": "开发快速助手,一个包含常用功能的命令行工具,旨在提升开发效率",
5
5
  "sideEffects": false,
6
6
  "main": "./src/index.js",