"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=default_1;const minify_script_task_1=require("./script_task/minify_script_task");function default_1(e){const t=e.setting.minified;return{name:"summer-terser",workerMethods:{doCompress:minify_script_task_1.doCompress},async compress(e,s){const r=e.targetPath;if(!t||"dev"===s.resultType||!r.endsWith(".js"))return e;const o=Date.now(),a=await this.runWorkerMethod("doCompress",r,{code:e.target.code,map:e.target.map});return Object.assign(Object.assign({},e),{target:Object.assign(Object.assign({},e.target),{code:a.code,map:a.map}),process:[...e.process,{cost:Date.now()-o,pluginName:"summer-terser",action:"compress"}]})}}}