@ray-js/builder-mp 1.3.1-beta.6 → 1.3.1
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/build.rjs.js +13 -13
- package/lib/build.worker.js +3 -1
- package/lib/plugins/resolve-alias.js +3 -1
- package/package.json +12 -10
package/lib/build.rjs.js
CHANGED
@@ -21,9 +21,7 @@ class RjsBuild {
|
|
21
21
|
this.options = options;
|
22
22
|
this.parent = parent;
|
23
23
|
this.initRjsBuilder();
|
24
|
-
|
25
|
-
this.run();
|
26
|
-
});
|
24
|
+
this.run();
|
27
25
|
}
|
28
26
|
createWebpackConfig() {
|
29
27
|
const { cwd, output, mini, target } = this.options;
|
@@ -139,19 +137,21 @@ class RjsBuild {
|
|
139
137
|
}
|
140
138
|
run() {
|
141
139
|
const cb = this.runOrWatch();
|
142
|
-
|
143
|
-
if (
|
144
|
-
this.watcher
|
140
|
+
this.parent.hooks.afterCompile.tap(LOG_PREFIX_RJS, () => {
|
141
|
+
if (this.options.watch) {
|
142
|
+
if (!this.watcher) {
|
143
|
+
this.watcher = this.compiler.watch({}, cb);
|
144
|
+
}
|
145
|
+
else {
|
146
|
+
this.watcher.close(() => {
|
147
|
+
this.watcher = this.compiler.watch({}, cb);
|
148
|
+
});
|
149
|
+
}
|
145
150
|
}
|
146
151
|
else {
|
147
|
-
this.
|
148
|
-
this.watcher = this.compiler.watch({}, cb);
|
149
|
-
});
|
152
|
+
this.compiler.run(cb);
|
150
153
|
}
|
151
|
-
}
|
152
|
-
else {
|
153
|
-
this.compiler.run(cb);
|
154
|
-
}
|
154
|
+
});
|
155
155
|
return this.compiler;
|
156
156
|
}
|
157
157
|
}
|
package/lib/build.worker.js
CHANGED
@@ -65,7 +65,9 @@ exports.default = {
|
|
65
65
|
.options({ builder: builder_1.builder })
|
66
66
|
.end();
|
67
67
|
config.plugin('webpack-define-plugin').tap(([args]) => {
|
68
|
-
return [
|
68
|
+
return [
|
69
|
+
Object.assign(Object.assign({}, args), { 'process.env.PLATFORM': JSON.stringify(target), 'process.env.RAY_DEBUG': JSON.stringify(`${process.env.RAY_DEBUG === 'true'}`) }),
|
70
|
+
];
|
69
71
|
});
|
70
72
|
config.resolve.alias.set('@ray-core/ray', path_1.default.dirname(require.resolve('@ray-core/ray/package.json')));
|
71
73
|
config.resolve.alias.set('@ray-js/rjs-for-wechat', path_1.default.dirname(require.resolve('@ray-js/rjs-for-wechat/package.json')));
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@ray-js/builder-mp",
|
3
|
-
"version": "1.3.1
|
3
|
+
"version": "1.3.1",
|
4
4
|
"description": "Ray builder for mini program",
|
5
5
|
"keywords": [
|
6
6
|
"ray"
|
@@ -21,17 +21,19 @@
|
|
21
21
|
"test": "jest"
|
22
22
|
},
|
23
23
|
"dependencies": {
|
24
|
+
"@babel/plugin-proposal-private-methods": "^7.18.6",
|
25
|
+
"@babel/plugin-proposal-private-property-in-object": "^7.21.11",
|
24
26
|
"@babel/template": "^7.16.0",
|
25
27
|
"@babel/traverse": "^7.16.3",
|
26
28
|
"@babel/types": "^7.16.0",
|
27
|
-
"@ray-core/babel-preset-remax": "^0.3.0
|
28
|
-
"@ray-core/build-store": "^0.3.0
|
29
|
-
"@ray-core/cli": "^0.3.0
|
30
|
-
"@ray-core/ray": "^0.3.0
|
31
|
-
"@ray-js/adapter": "^1.3.1
|
29
|
+
"@ray-core/babel-preset-remax": "^0.3.0",
|
30
|
+
"@ray-core/build-store": "^0.3.0",
|
31
|
+
"@ray-core/cli": "^0.3.0",
|
32
|
+
"@ray-core/ray": "^0.3.0",
|
33
|
+
"@ray-js/adapter": "^1.3.1",
|
32
34
|
"@ray-js/rjs-for-wechat": "^0.0.3",
|
33
|
-
"@ray-js/shared": "^1.3.1
|
34
|
-
"@ray-js/types": "^1.3.1
|
35
|
+
"@ray-js/shared": "^1.3.1",
|
36
|
+
"@ray-js/types": "^1.3.1",
|
35
37
|
"babel-loader": "^8.2.3",
|
36
38
|
"babel-plugin-minify-dead-code-elimination": "^0.5.1",
|
37
39
|
"babel-plugin-transform-prune-unused-imports": "^1.0.1",
|
@@ -48,7 +50,7 @@
|
|
48
50
|
"webpack-virtual-modules": "^0.4.4"
|
49
51
|
},
|
50
52
|
"devDependencies": {
|
51
|
-
"@ray-core/types": "^0.3.0
|
53
|
+
"@ray-core/types": "^0.3.0",
|
52
54
|
"@types/jest": "^27.0.2",
|
53
55
|
"@types/node": "^16.9.1",
|
54
56
|
"babel-plugin-tester": "^10.1.0",
|
@@ -62,6 +64,6 @@
|
|
62
64
|
"email": "tuyafe@tuya.com"
|
63
65
|
}
|
64
66
|
],
|
65
|
-
"gitHead": "
|
67
|
+
"gitHead": "4844c0f03bb434999b2e93196dba1cd53b9b6c56",
|
66
68
|
"repository": {}
|
67
69
|
}
|