@dcloudio/uni-push 3.0.0-alpha-3050120220706002 → 3.0.0-alpha-3050220220719001
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/lib/uni.plugin.js +14 -5
- package/package.json +2 -2
- package/lib/.DS_Store +0 -0
package/lib/uni.plugin.js
CHANGED
@@ -9,7 +9,8 @@ var path__default = /*#__PURE__*/_interopDefaultLegacy(path);
|
|
9
9
|
|
10
10
|
var index = () => [
|
11
11
|
uniCliShared.defineUniMainJsPlugin((opts) => {
|
12
|
-
let
|
12
|
+
let isEnableV1 = false;
|
13
|
+
let isEnableV2 = false;
|
13
14
|
let isOffline = false;
|
14
15
|
return {
|
15
16
|
name: 'uni:push',
|
@@ -20,10 +21,16 @@ var index = () => [
|
|
20
21
|
}
|
21
22
|
const inputDir = process.env.UNI_INPUT_DIR;
|
22
23
|
const platform = process.env.UNI_PLATFORM;
|
23
|
-
|
24
|
-
|
24
|
+
isEnableV1 = uniCliShared.isEnableUniPushV1(inputDir, platform);
|
25
|
+
isEnableV2 = uniCliShared.isEnableUniPushV2(inputDir, platform);
|
26
|
+
// v1
|
27
|
+
if (isEnableV1) {
|
25
28
|
return;
|
26
29
|
}
|
30
|
+
if (!isEnableV2) {
|
31
|
+
return;
|
32
|
+
}
|
33
|
+
// v2
|
27
34
|
isOffline = platform === 'app' && uniCliShared.isUniPushOffline(inputDir);
|
28
35
|
if (isOffline) {
|
29
36
|
return;
|
@@ -36,14 +43,16 @@ var index = () => [
|
|
36
43
|
},
|
37
44
|
resolveId(id) {
|
38
45
|
if (id === '@dcloudio/uni-push') {
|
39
|
-
return uniCliShared.resolveBuiltIn(path__default["default"].join('@dcloudio/uni-push', isOffline
|
46
|
+
return uniCliShared.resolveBuiltIn(path__default["default"].join('@dcloudio/uni-push', isOffline || isEnableV1
|
47
|
+
? 'dist/uni-push.plus.es.js'
|
48
|
+
: 'dist/uni-push.es.js'));
|
40
49
|
}
|
41
50
|
},
|
42
51
|
transform(code, id) {
|
43
52
|
if (!opts.filter(id)) {
|
44
53
|
return;
|
45
54
|
}
|
46
|
-
if (
|
55
|
+
if (isEnableV1 || isEnableV2) {
|
47
56
|
return {
|
48
57
|
code: `import '@dcloudio/uni-push';` + code,
|
49
58
|
map: null,
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@dcloudio/uni-push",
|
3
|
-
"version": "3.0.0-alpha-
|
3
|
+
"version": "3.0.0-alpha-3050220220719001",
|
4
4
|
"description": "@dcloudio/uni-push",
|
5
5
|
"main": "lib/uni-push.js",
|
6
6
|
"module": "lib/uni-push.js",
|
@@ -20,6 +20,6 @@
|
|
20
20
|
},
|
21
21
|
"gitHead": "33e807d66e1fe47e2ee08ad9c59247e37b8884da",
|
22
22
|
"dependencies": {
|
23
|
-
"@dcloudio/uni-cli-shared": "3.0.0-alpha-
|
23
|
+
"@dcloudio/uni-cli-shared": "3.0.0-alpha-3050220220719001"
|
24
24
|
}
|
25
25
|
}
|
package/lib/.DS_Store
DELETED
Binary file
|