first commit

This commit is contained in:
2026-09-08 20:28:54 +08:00
commit 2ada8d3d5a
37380 changed files with 4886169 additions and 0 deletions
+2
View File
@@ -0,0 +1,2 @@
"use strict";var _compiler=require("@hap-toolkit/compiler");class Css2jsonPlugin{constructor(s){this.options=s}apply(s){s.hooks.emit.tapAsync("Css2jsonPlugin",(s,t)=>{for(const t in s.assets)if(t.match(/css\.json$/)){const e=s.assets[t]._source.children.filter(s=>s._value),o=e.length;e.map((s,e)=>{this.css2Json({code:s._value,filePath:t},t=>{let c="";0===e?(c='{"list":['+t,c+=e===o-1?"]}":","):(c=t,c+=e<o-1?",":"]}"),s._value=c})})}t()}),s.hooks.afterEmit.tapAsync("Css2jsonPlugin",(s,t)=>{for(const t in s.assets)t.match(/css\.json$/)&&(s.assets[t]._source.children=[]);t()})}css2Json(s,t){const e=String(s.code).match(/\[(.*)\]/);let o={};const{parsed:c}=(0,_compiler.parseStyle)(s);let n=c;if(e&&e[1]){o[e[1]]=n}else o=n;t&&t(o)}}module.exports=Css2jsonPlugin;
//# sourceMappingURL=css2json-plugin.js.map
+2
View File
@@ -0,0 +1,2 @@
"use strict";var _path=_interopRequireDefault(require("path")),_webpackSources=require("webpack-sources");function _interopRequireDefault(n){return n&&n.__esModule?n:{default:n}}const extList=[".mix",".ux",".vue"];class InstVuePlugin{constructor(n){this.options=n}apply(n){const e=this;n.hooks.compilation.tap("InstVuePlugin",(function(n){n.hooks.optimizeChunkAssets.tapAsync("InstVuePlugin",(function(t,o){t.forEach((function(t){_path.default.extname(Array.from(t.entryModule.buildInfo.fileDependencies)[0])===extList[2]&&t.files.forEach((function(t){const o=e.instVue(t,n);o&&(n.assets[t]=o)}))})),o()}))}))}instVue(n,e){if(/\.js$/.test(n))return n.match(/\bapp\.js$/)?new _webpackSources.ConcatSource("(function(){\n var handler = function() {\n return ",e.assets[n],`\n };\n if (typeof window === "undefined") {\n let options = handler();\n options.default['manifest'] = ${JSON.stringify(global.framework.manifest)}\n $app_define$(options.default)\n $app_bootstrap$()\n }\n })();`):new _webpackSources.ConcatSource("(function(){\n var handler = function() {\n return ",e.assets[n],"\n };\n if (typeof window === \"undefined\") {\n let options = handler();\n options = options.default ? options.default: options\n options['type'] = 'page'\n new Vue({render: function(h) {return h(options)}}).$mount('#app')\n }\n })();")}}module.exports=InstVuePlugin;
//# sourceMappingURL=instvue-plugin.js.map