@hap-toolkit/dsl-xvm 1.9.9 → 1.9.10-beta
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.
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var _webpack=_interopRequireDefault(require("webpack")),
|
|
1
|
+
"use strict";var _webpack=_interopRequireDefault(require("webpack")),_JavascriptModulesPlugin=_interopRequireDefault(require("webpack/lib/javascript/JavascriptModulesPlugin")),_NormalModule=_interopRequireDefault(require("webpack/lib/NormalModule"));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}let ConcatSource,OriginalSource;const{util:{createHash:createHash}}=_webpack.default,MODULE_TYPE="css/extract",pluginName="css-extract-plugin",REGEXP_NAME=/\[name\]/i,REGEXP_PLACEHOLDERS=/\[name\]/g,DEFAULT_FILENAME="[name].css.json";class CssDependency extends _webpack.default.Dependency{constructor({identifier:e,content:t,media:n,sourceMap:i},s,r){super(),this.identifier=e,this.identifierIndex=r,this.content=t,this.media=n,this.sourceMap=i,this.context=s}getResourceIdentifier(){return`css-module-${this.identifier}-${this.identifierIndex}`}}class CssDependencyTemplate{apply(){}}class CssModule extends _webpack.default.Module{constructor(e){super(MODULE_TYPE,e.context),this.id="",this._identifier=e.identifier,this._identifierIndex=e.identifierIndex,this.content=e.content,this.media=e.media,this.sourceMap=e.sourceMap}size(){return this.content.length}identifier(){return`css ${this._identifier} ${this._identifierIndex}`}readableIdentifier(e){return`css ${e.shorten(this._identifier)}${this._identifierIndex?` (${this._identifierIndex})`:""}`}nameForCondition(){const e=this._identifier.split("!").pop(),t=e.indexOf("?");return t>=0?e.substring(0,t):e}updateCacheModule(e){this.content=e.content,this.media=e.media,this.sourceMap=e.sourceMap}needRebuild(){return!0}build(e,t,n,i,s){this.buildInfo={},this.buildMeta={},s()}updateHash(e,t){t.chunkGraph.moduleGraph.getExportsInfo(this).updateHash(e),e.update(this.content),e.update(this.media||""),e.update(this.sourceMap?JSON.stringify(this.sourceMap):"")}}class CssModuleFactory{create({dependencies:[e]},t){t(null,new CssModule(e))}}class ExtractCssPlugin{constructor(e={}){if(this.options=Object.assign({filename:DEFAULT_FILENAME,moduleFilename:()=>this.options.filename||DEFAULT_FILENAME,ignoreOrder:!1},e),!this.options.chunkFilename){const{filename:e}=this.options;e.match(REGEXP_PLACEHOLDERS)&&(this.options.chunkFilename=e)}}apply(e){ConcatSource=e.webpack.sources.ConcatSource,OriginalSource=e.webpack.sources.OriginalSource,e.hooks.thisCompilation.tap(pluginName,(e=>{_NormalModule.default.getCompilationHooks(e).loader.tap(pluginName,((e,t)=>{const n=t;e[MODULE_TYPE]=e=>{n.addDependency(new CssDependency(e,t.context,0))}})),e.dependencyFactories.set(CssDependency,new CssModuleFactory),e.dependencyTemplates.set(CssDependency,new CssDependencyTemplate),e.hooks.renderManifest.tap(pluginName,((t,{chunk:n})=>{const i=Array.from(e.chunkGraph.getOrderedChunkModulesIterable(n)).filter((e=>e.type===MODULE_TYPE));i.length>0&&t.push({render:()=>this.renderContentAsset(e,n,i,e.runtimeTemplate.requestShortener),filenameTemplate:({chunk:e})=>this.options.moduleFilename(e),pathOptions:{chunk:n,contentHashType:MODULE_TYPE},identifier:`${pluginName}.${n.id}`,hash:n.contentHash[MODULE_TYPE]})})),_JavascriptModulesPlugin.default.getCompilationHooks(e).chunkHash.tap(pluginName,((e,t)=>{const{chunkFilename:n}=this.options;REGEXP_NAME.test(n)&&t.update(JSON.stringify(e.getChunkMaps(!0).name))})),e.hooks.contentHash.tap(pluginName,(t=>{const{outputOptions:n}=e,{hashFunction:i,hashDigest:s,hashDigestLength:r}=n,o=createHash(i);for(const n of Array.from(e.chunkGraph.getChunkEntryModulesIterable(t)))n.type===MODULE_TYPE&&n.updateHash(o,e);const{contentHash:a}=t;a[MODULE_TYPE]=o.digest(s).substring(0,r)}))}))}renderContentAsset(e,t,n,i){let s;const[r]=t.groupsIterable;if("function"==typeof r.getModulePostOrderIndex){const r=new Map(n.map((e=>[e,new Set]))),o=Array.from(t.groupsIterable,(e=>{const t=n.map((t=>({module:t,index:e.getModulePostOrderIndex(t)}))).filter((e=>void 0!==e.index)).sort(((e,t)=>t.index-e.index)).map((e=>e.module));for(let e=0;e<t.length;e++){const n=r.get(t[e]);for(let i=e+1;i<t.length;i++)n.add(t[i])}return t}));s=new Set;const a=e=>!s.has(e);for(;s.size<n.length;){let n,d,c=!1;for(const e of o){for(;e.length>0&&s.has(e[e.length-1]);)e.pop();if(0!==e.length){const t=e[e.length-1],i=r.get(t),o=Array.from(i).filter(a);if((!d||d.length>o.length)&&(n=e,d=o),0===o.length){const t=e.pop();s.add(t),c=!0;break}}}if(!c){const r=n.pop();this.options.ignoreOrder||e.warnings.push(new Error(`chunk ${t.name||t.id} [${pluginName}]\nConflicting order between:\n * ${r.readableIdentifier(i)}\n${d.map((e=>` * ${e.readableIdentifier(i)}`)).join("\n")}`)),s.add(r)}}}else n.sort(((e,t)=>e.index2-t.index2)),s=n;const o=new ConcatSource;o.add('{ "list": [\n');let a=0;return s.forEach(((e,t,n)=>{o.add(new OriginalSource(e.content,e.readableIdentifier(i))),++a!==n.size&&(o.add(","),o.add("\n"))})),o.add("\n]}"),new ConcatSource(o)}}module.exports=ExtractCssPlugin;
|
|
2
2
|
//# sourceMappingURL=extract-css-plugin.js.map
|
package/lib/webpack.post.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";const{compileOptionsObject:compileOptionsObject}=require("@hap-toolkit/shared-utils/compilation-config"),{loaderWrapper:loaderWrapper}=require("@hap-toolkit/packager/lib/common/utils");module.exports.postHook=function(e,{cwd:r,pathSrc:
|
|
1
|
+
"use strict";const{compileOptionsObject:compileOptionsObject}=require("@hap-toolkit/shared-utils/compilation-config"),{loaderWrapper:loaderWrapper}=require("@hap-toolkit/packager/lib/common/utils");module.exports.postHook=function(e,{cwd:r,pathSrc:s},o){let l={module:{rules:[]}};o&&(l=o,l.webpack&&(l=l.webpack));if((l&&l.module&&l.module.rules||[]).forEach((r=>{r.test.exec(".ts")&&loaderWrapper(s,r),e.module.rules.push(r)})),e.module.rules.push({test:/\.(ux|mix)/,oneOf:[{resourceQuery:/uxType=app/,use:require.resolve("./loaders/app-loader.js")},{resourceQuery:/uxType=(page|comp|card)/,use:require.resolve("./loaders/ux-loader.js")},{use:require.resolve("./loaders/ux-loader.js")}]}),compileOptionsObject.enableExtractCss){const r=require("./plugins/extract-css-plugin");e.plugins.push(new r)}e.plugins.push(...l&&l.plugins||[]),Object.keys(e.resolve).forEach((r=>{const s=e.resolve[r];s instanceof Array?s.push(...l.resolve&&l.resolve[r]||[]):"object"==typeof s&&null!==s&&Object.assign(s,l.resolve&&l.resolve[r]||{})})),Object.keys(l&&l.resolve||{}).forEach((r=>{r in e.resolve||(e.resolve[r]=l.resolve[r])}))};
|
|
2
2
|
//# sourceMappingURL=webpack.post.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hap-toolkit/dsl-xvm",
|
|
3
|
-
"version": "1.9.
|
|
3
|
+
"version": "1.9.10-beta",
|
|
4
4
|
"description": "webpack {loader,plugin} for supporting xvm in quickapp",
|
|
5
5
|
"engines": {
|
|
6
6
|
"node": ">=8.0.0"
|
|
@@ -33,13 +33,14 @@
|
|
|
33
33
|
"!**/.DS_Store"
|
|
34
34
|
],
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@hap-toolkit/compiler": "1.9.
|
|
37
|
-
"@hap-toolkit/packager": "1.9.
|
|
38
|
-
"@hap-toolkit/shared-utils": "1.9.
|
|
36
|
+
"@hap-toolkit/compiler": "1.9.10-beta",
|
|
37
|
+
"@hap-toolkit/packager": "1.9.10-beta",
|
|
38
|
+
"@hap-toolkit/shared-utils": "1.9.10-beta",
|
|
39
39
|
"babel-loader": "^8.1.0",
|
|
40
40
|
"css-loader": "^5.0.1",
|
|
41
|
+
"loader-utils": "2.0.2",
|
|
41
42
|
"url-loader": "^4.1.1",
|
|
42
43
|
"webpack": "5.72.0"
|
|
43
44
|
},
|
|
44
|
-
"gitHead": "
|
|
45
|
+
"gitHead": "f74d2f174adfbba983d99816b254b2afe5918c61"
|
|
45
46
|
}
|