UNPKG

cep-webpack-plugin

Version:

Webpack plugin that emits a CSXS/manifest.xml file for Adobe CEP extensions.

6 lines • 3.42 kB
/*! *** cep-webpack-plugin 1.2.0 *** Copyright © 2019, Jaid <jaid.jsx@gmail.com> (https://github.com/Jaid) *** See https://github.com/Jaid/cep-webpack-plugin#readme !*/ var e,t;e=global,t=function(){return function(e){var t={};function n(i){if(t[i])return t[i].exports;var o=t[i]={i,l:!1,exports:{}};return e[i].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,i){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:i})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(i,o,function(t){return e[t]}.bind(null,o));return i},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=5)}([function(e,t){e.exports=require("ow")},function(e,t){e.exports=require("ensure-object")},function(e,t){e.exports=require("resolve-any")},function(e,t){e.exports=require("xmlbuilder")},function(e,t){e.exports={photoshop:{host:"PHSP"},indesign:{host:"IDSN"},incopy:{host:"AICY"},illustrator:{host:"ILST"},premierePro:{host:"PPRO"},prelude:{host:"PRLD"},afterEffects:{host:"AEFT"},animate:{host:"FLPR"},audition:{host:"AUDT"},dreamweaver:{host:"DRWV"},muse:{host:"MUSE"},bridge:{host:"KBRG"},rush:{host:"RUSH"}}},function(e,t,n){n.r(t);var i=n(1),o=n.n(i),s=n(0),r=n.n(s),u=n(2),p=n.n(u),a=n(3),c=n.n(a),f=n(4),l=n.n(f);t.default=class{constructor(e){const t=o()(e,"identifier");this.options={fileName:"CSXS/manifest.xml",version:"1.0.0",title:t.title||t.identifier,requiredCefVersion:"9.0",apps:{photoshop:"20"},mainPath:"./index.html",panel:!0,minify:!0,...t},r()(this.options.identifier,r.a.string.nonEmpty)}apply(e){e.hooks.emit.tapPromise("CepWebpackPlugin",async e=>{const t=`${this.options.identifier}.extension`,n=[];for(const[e,t]of Object.entries(this.options.apps)){const i=l.a[e];n.push({"@Name":i.host,"@Version":t})}const i={ExtensionManifest:{"@xmlns:xsi":"http://www.w3.org/2001/XMLSchema-instance","@Version":"8.0","@ExtensionBundleId":this.options.identifier,"@ExtensionBundleVersion":this.options.version,"@ExtensionBundleName":this.options.title,ExtensionList:{Extension:{"@Id":t,"@Version":this.options.version}},ExecutionEnvironment:{RequiredRuntimeList:{RequiredRuntime:{"@Name":"CSXS","@Version":this.options.requiredCefVersion}},HostList:{Host:n},LocaleList:{Locale:{"@Code":"All"}}},DispatchInfoList:{Extension:{"@Id":t,DispatchInfo:{Resources:{MainPath:this.options.mainPath},Lifecycle:{AutoVisible:!0}}}}}};if(this.options.panel){const e={title:this.options.title,height:600,width:200};i.ExtensionManifest.DispatchInfoList.UI={Type:"Panel",Menu:e.title,Geometry:{Size:{Height:e.height,Width:e.width}}}}const o=c.a.create(i,{encoding:"UTF-8"}).end({pretty:!this.options.minify}),s=await p()(this.options.fileName);e.assets[s]={source:()=>o,size:()=>o.length}})}}}])},"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports["cep-webpack-plugin"]=t():e.CepWebpackPlugin=t();