binhend 2.1.13 → 2.1.14

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "binhend",
3
- "version": "2.1.13",
3
+ "version": "2.1.14",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "author": "Nguyen Duc Binh",
package/src/web/code.js CHANGED
@@ -66,7 +66,7 @@ function getDependencyDelaration(component) {
66
66
  var declarationCode = codes.join(',');
67
67
 
68
68
  codes = [];
69
- codes.push(`var Binh = _Binh;`);
69
+ codes.push(`var Binh = _Binh, require = Binh.r;`);
70
70
 
71
71
  if (declarationCode) {
72
72
  codes.push(`var${declarationCode};`);
@@ -7,7 +7,7 @@ const PREFIX_CODE =
7
7
  `var { context, tag, svg, script, require, css } = binh.context(module, require);
8
8
  var Binh = binh.Binh;
9
9
  binh.component(context, ui, service, style);
10
- var ui = null, service = null, style = null;\r\n\r\n`;
10
+ var ui = ui || null, service = service || null, style = style || null;\r\n\r\n`;
11
11
 
12
12
  function generate(sourceRootPath, outputRootPath, callbackDone) {
13
13
  if (sourceRootPath == undefined || outputRootPath == undefined) return;
@@ -74,6 +74,7 @@ binh.component = function (context, ui, service, style) {
74
74
 
75
75
  var module = context.module;
76
76
  module.exports = component;
77
+ module.exportss = component;
77
78
 
78
79
  component.module = module;
79
80
  component.constructor = Component;
@@ -93,7 +94,8 @@ binh.component = function (context, ui, service, style) {
93
94
  };
94
95
 
95
96
  binh.final = function (module) {
96
- var component = module.exports;
97
+ var component = module.exportss || {};
98
+ module.exports = component;
97
99
 
98
100
  component.eachChild && component.eachChild(childComponent => {
99
101
  if (childComponent.alias?.[component.filename]) {
@@ -125,7 +127,9 @@ binh.css = function (module, cssFilename) {
125
127
  binh.final(module);
126
128
  };
127
129
 
128
- binh.Binh = function () { }; // dummy Binh object for binhjs => build web not logging error of undefined
130
+ /** Dummy Binh object for binhjs => build web not logging error of undefined */
131
+ binh.Binh = function () { };
132
+ binh.Binh.Util = { require: function () {} };
129
133
 
130
134
  function alias(name) {
131
135
  if (!isString(name)) return this;