{"version":3,"file":"index.mjs","names":[],"sources":["../src/index.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n                   🗲 Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website:                  https://stormsoftware.com\n Repository:               https://github.com/storm-software/powerlines\n Documentation:            https://docs.stormsoftware.com/projects/powerlines\n Contact:                  https://stormsoftware.com/contact\n\n SPDX-License-Identifier:  Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { build } from \"@storm-software/unbuild\";\nimport type { Plugin } from \"powerlines\";\nimport { formatConfig } from \"powerlines/plugin-utils\";\nimport { resolveOptions } from \"./helpers/resolve-options\";\nimport type {\n  UnbuildPluginContext,\n  UnbuildPluginOptions\n} from \"./types/plugin\";\n\nexport * from \"./helpers\";\nexport type * from \"./types\";\n\ndeclare module \"powerlines\" {\n  interface Config {\n    unbuild?: UnbuildPluginOptions;\n  }\n}\n\n/**\n * A Powerlines plugin to build projects using Unbuild.\n */\nexport const plugin = <\n  TContext extends UnbuildPluginContext = UnbuildPluginContext\n>(\n  options: UnbuildPluginOptions = {}\n): Plugin<TContext> => {\n  return {\n    name: \"unbuild\",\n    config() {\n      return {\n        output: {\n          format: [\"esm\"]\n        },\n        unbuild: {\n          ...options\n        }\n      };\n    },\n    async build() {\n      this.debug(\"Starting Unbuild build process...\");\n\n      const options = resolveOptions(this);\n\n      this.debug({\n        meta: {\n          category: \"config\"\n        },\n        message: `Resolved Unbuild configuration: \\n${formatConfig(options)}`\n      });\n\n      await build(options);\n    }\n  };\n};\n\n"],"mappings":";;;;;;;;;AAuCA,MAAa,UAGX,UAAgC,CAAC,MACZ;CACrB,OAAO;EACL,MAAM;EACN,SAAS;GACP,OAAO;IACL,QAAQ,EACN,QAAQ,CAAC,KAAK,EAChB;IACA,SAAS,EACP,GAAG,QACL;GACF;EACF;EACA,MAAM,QAAQ;GACZ,KAAK,MAAM,mCAAmC;GAE9C,MAAM,UAAU,eAAe,IAAI;GAEnC,KAAK,MAAM;IACT,MAAM,EACJ,UAAU,SACZ;IACA,SAAS,qCAAqC,aAAa,OAAO;GACpE,CAAC;GAED,MAAM,MAAM,OAAO;EACrB;CACF;AACF"}