@dcloudio/uni-cli-shared 3.0.0-alpha-3021220211105012 → 3.0.0-alpha-3021320211109003
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/dist/utils.js +20 -2
- package/package.json +3 -3
package/dist/utils.js
CHANGED
|
@@ -39,18 +39,36 @@ function resolveComponentsLibPath() {
|
|
|
39
39
|
exports.resolveComponentsLibPath = resolveComponentsLibPath;
|
|
40
40
|
const ownerModules = ['@dcloudio/uni-app', '@dcloudio/vite-plugin-uni'];
|
|
41
41
|
const paths = [];
|
|
42
|
+
function resolveNodeModulePath(modulePath) {
|
|
43
|
+
const nodeModulesPaths = [];
|
|
44
|
+
const nodeModulesPath = path_1.default.join(modulePath, 'node_modules');
|
|
45
|
+
if (fs_1.default.existsSync(nodeModulesPath)) {
|
|
46
|
+
nodeModulesPaths.push(nodeModulesPath);
|
|
47
|
+
}
|
|
48
|
+
const index = modulePath.lastIndexOf('node_modules');
|
|
49
|
+
if (index > -1) {
|
|
50
|
+
nodeModulesPaths.push(path_1.default.join(modulePath.substr(0, index), 'node_modules'));
|
|
51
|
+
}
|
|
52
|
+
return nodeModulesPaths;
|
|
53
|
+
}
|
|
42
54
|
function initPaths() {
|
|
43
55
|
const cliContext = process.env.UNI_CLI_CONTEXT;
|
|
44
56
|
if (cliContext) {
|
|
45
57
|
const pathSet = new Set();
|
|
46
58
|
pathSet.add(path_1.default.join(cliContext, 'node_modules'));
|
|
47
59
|
[`@dcloudio/uni-` + process.env.UNI_PLATFORM, ...ownerModules].forEach((ownerModule) => {
|
|
60
|
+
let pkgPath = '';
|
|
48
61
|
try {
|
|
49
|
-
|
|
62
|
+
pkgPath = require.resolve(ownerModule + '/package.json', {
|
|
50
63
|
paths: [cliContext],
|
|
51
|
-
})
|
|
64
|
+
});
|
|
52
65
|
}
|
|
53
66
|
catch (e) { }
|
|
67
|
+
if (pkgPath) {
|
|
68
|
+
resolveNodeModulePath(path_1.default.dirname(pkgPath)).forEach((nodeModulePath) => {
|
|
69
|
+
pathSet.add(nodeModulePath);
|
|
70
|
+
});
|
|
71
|
+
}
|
|
54
72
|
});
|
|
55
73
|
paths.push(...pathSet);
|
|
56
74
|
(0, debug_1.default)('uni-paths')(paths);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dcloudio/uni-cli-shared",
|
|
3
|
-
"version": "3.0.0-alpha-
|
|
3
|
+
"version": "3.0.0-alpha-3021320211109003",
|
|
4
4
|
"description": "@dcloudio/uni-cli-shared",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -20,8 +20,8 @@
|
|
|
20
20
|
"dependencies": {
|
|
21
21
|
"@babel/parser": "^7.15.0",
|
|
22
22
|
"@babel/types": "^7.15.0",
|
|
23
|
-
"@dcloudio/uni-i18n": "3.0.0-alpha-
|
|
24
|
-
"@dcloudio/uni-shared": "3.0.0-alpha-
|
|
23
|
+
"@dcloudio/uni-i18n": "3.0.0-alpha-3021320211109003",
|
|
24
|
+
"@dcloudio/uni-shared": "3.0.0-alpha-3021320211109003",
|
|
25
25
|
"@rollup/pluginutils": "^4.1.1",
|
|
26
26
|
"@vue/compiler-core": "^3.2.21",
|
|
27
27
|
"@vue/compiler-dom": "^3.2.21",
|