binhend 2.1.10 → 2.1.12
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/package.json +1 -1
- package/src/api/Router.js +1 -4
- package/src/web/code.js +2 -1
- package/src/web/index.js +2 -0
package/package.json
CHANGED
package/src/api/Router.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
|
|
2
|
-
const { Module } = require('module');
|
|
3
2
|
const { ServerResponse } = require('http');
|
|
4
3
|
const { isFunction } = require('../utils/typeOf');
|
|
5
4
|
const responseErrorByDefault = require('./responseErrorByDefault');
|
|
@@ -29,9 +28,7 @@ function Router(moduleInstance) {
|
|
|
29
28
|
};
|
|
30
29
|
}
|
|
31
30
|
|
|
32
|
-
|
|
33
|
-
moduleInstance.exports = router;
|
|
34
|
-
}
|
|
31
|
+
moduleInstance.exports = router;
|
|
35
32
|
|
|
36
33
|
output.trycatch = trycatch;
|
|
37
34
|
|
package/src/web/code.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
const path = require('path');
|
|
3
|
+
const Component = require('./component');
|
|
3
4
|
|
|
4
5
|
function getCodeOfDependencies(component, metadata) {
|
|
5
6
|
var global = metadata || {};
|
|
@@ -112,7 +113,7 @@ function generateOptionCode(component, baseCode) {
|
|
|
112
113
|
}
|
|
113
114
|
|
|
114
115
|
// Services
|
|
115
|
-
options.services.forEach(function(serviceModule) {
|
|
116
|
+
if (Component.isLazy) options.services.forEach(function(serviceModule) {
|
|
116
117
|
serviceUrls.push(serviceModule.url);
|
|
117
118
|
});
|
|
118
119
|
|
package/src/web/index.js
CHANGED
|
@@ -21,10 +21,12 @@ function WebBuilder(source, { output, external } = {}) {
|
|
|
21
21
|
var external = mustString(external) || 'NPM';
|
|
22
22
|
|
|
23
23
|
this.bundle = () => {
|
|
24
|
+
Component.isLazy = false;
|
|
24
25
|
ComponentFormat.generate(source, module, () => ComponentBuild.bundle({ source, web, module }));
|
|
25
26
|
};
|
|
26
27
|
|
|
27
28
|
this.lazy = () => {
|
|
29
|
+
Component.isLazy = true;
|
|
28
30
|
ComponentFormat.generate(source, module, () => ComponentBuild.lazyload({ source, web, module, external }));
|
|
29
31
|
};
|
|
30
32
|
|