binhend 2.0.6 → 2.0.7
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/web/component.format.js +2 -0
- package/src/web/component.method.js +11 -0
- package/testa.js +7 -0
package/package.json
CHANGED
|
@@ -28,9 +28,11 @@ function generate(sourceRootPath, outputRootPath, callbackDone) {
|
|
|
28
28
|
if (fileExtension === '.css') {
|
|
29
29
|
var cssModuleCode = 'binh.css(module);';
|
|
30
30
|
writeToFileIfNew(fileOutputPath + '.js', cssModuleCode);
|
|
31
|
+
// not return here, but wait for next "if" statement to be copied to build folder, then return there.
|
|
31
32
|
}
|
|
32
33
|
|
|
33
34
|
if (fileExtension !== '.js') {
|
|
35
|
+
// any files not JS (.css, .jpg, etc.) will be copied to build folder.
|
|
34
36
|
return cloneFileIfNew(fileSourcePath, fileOutputPath);
|
|
35
37
|
}
|
|
36
38
|
|
|
@@ -47,6 +47,15 @@ function customRequire(filePath) {
|
|
|
47
47
|
return this.require(filePath);
|
|
48
48
|
}
|
|
49
49
|
|
|
50
|
+
function applyDefaultFileCSS() {
|
|
51
|
+
var cssModuleFile = path.parse(this.module.filename).name + '.css.js';
|
|
52
|
+
try {
|
|
53
|
+
var cssModule = this.require(cssModuleFile);
|
|
54
|
+
css.bind(this)(cssModule);
|
|
55
|
+
}
|
|
56
|
+
catch (error) {}
|
|
57
|
+
}
|
|
58
|
+
|
|
50
59
|
function css() {
|
|
51
60
|
var csses = Array.from(arguments);
|
|
52
61
|
var appliedStyles = this.component.options.csses;
|
|
@@ -77,6 +86,8 @@ binh.component = function(context, ui, service, style) {
|
|
|
77
86
|
component.varname = getVariableName(component.filename);
|
|
78
87
|
component.as = alias;
|
|
79
88
|
component.eachChild = loopComponentChildren;
|
|
89
|
+
|
|
90
|
+
applyDefaultFileCSS.bind(context)();
|
|
80
91
|
};
|
|
81
92
|
|
|
82
93
|
binh.final = function(module) {
|