{"version":3,"sources":["jsdelivr-header.js","/npm/run-postcss-after-compilation-webpack-plugin@1.0.1/index.js"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA,ACNA,MAAM,KAAO,QAAQ,QACf,gBAAkB,QAAQ,mBAAmB,gBAC7C,QAAU,QAAQ,WAClB,kBAAoB,QAAQ,uBAGlC,MAAM,iCAEL,WAAA,CAAY,GAEX,IAAI,EAEH,MAAM,IAAI,MAAM,8DAGjB,KAAK,cAAgB,QAAQ,EAC9B,CAGA,KAAA,CAAM,GAEL,EAAS,MAAM,KAAK,SAAS,oCAAoC,CAAC,EAAa,KAC9E,kBAAkB,KAAK,eACrB,MAAK,EAAG,UAAS,cAEjB,MAAM,EAAW,OAAO,KAAK,EAAY,QACvC,QAAO,GAA+B,SAAvB,KAAK,QAAQ,KAC5B,KAAK,IACL,MAAM,EAAM,EAAY,OAAO,GAAM,SAC/B,EAAM,EAAY,OAAO,GAAM,MAC/B,EAAiB,OAAO,OAAO,CAAC,EAAG,EAAS,CAAE,KAAM,EAAM,GAAI,EAAM,IAAK,CAAE,KAAM,KAEvF,OAAO,QAAQ,GACb,QAAQ,EAAK,GACb,MAAM,IAEN,EAAY,OAAO,GAAQ,IAAI,gBAAgB,EAAO,IAAK,EAAM,EAAO,IAAI,GAC3E,IAGL,QAAQ,IAAI,GAAU,MAAK,IAAM,EAAS,OAAO,EAAS,GACxD,EAAS,GAEf,EAID,OAAO,QAAU","file":"/npm/run-postcss-after-compilation-webpack-plugin@1.0.1/index.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/run-postcss-after-compilation-webpack-plugin@1.0.1/index.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","const path = require(\"path\");\r\nconst SourceMapSource = require(\"webpack-sources\").SourceMapSource;\r\nconst postcss = require(\"postcss\");\r\nconst postcssLoadConfig = require(\"postcss-load-config\");\r\n\r\n\r\nclass RunPostCSSAfterCompilationPlugin\r\n{\r\n\tconstructor(configPath)\r\n\t{\r\n\t\tif(!configPath)\r\n\t\t{\r\n\t\t\tthrow new Error(\"You must pass the absolute path to postcss.config.js file.\");\r\n\t\t}\r\n\r\n\t\tthis.postcssConfig = require(configPath);\r\n\t}\r\n\r\n\t// eslint-disable-next-line class-methods-use-this\r\n\tapply(compiler)\r\n\t{\r\n\t\tcompiler.hooks.emit.tapAsync(\"RunPostCSSAfterCompilationPlugin\", (compilation, callback) => {\r\n\t\t\tpostcssLoadConfig(this.postcssConfig)\r\n\t\t\t\t.then(({ plugins, options }) =>\r\n\t\t\t\t{\r\n\t\t\t\t\tconst promises = Object.keys(compilation.assets)\r\n\t\t\t\t\t\t.filter(name => path.extname(name) === \".css\")\r\n\t\t\t\t\t\t.map((name) => {\r\n\t\t\t\t\t\t\tconst css = compilation.assets[name].source();\r\n\t\t\t\t\t\t\tconst map = compilation.assets[name].map();\r\n\t\t\t\t\t\t\tconst perFileOptions = Object.assign({}, options, { from: name, to: name, map: { prev: map } });\r\n\r\n\t\t\t\t\t\t\treturn postcss(plugins)\r\n\t\t\t\t\t\t\t\t.process(css, perFileOptions)\r\n\t\t\t\t\t\t\t\t.then((result) => {\r\n\t\t\t\t\t\t\t\t\t// eslint-disable-next-line no-param-reassign\r\n\t\t\t\t\t\t\t\t\tcompilation.assets[name] = new SourceMapSource(result.css, name, result.map);\r\n\t\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t});\r\n\r\n\t\t\t\t\tPromise.all(promises).then(() => callback(null), callback);\r\n\t\t\t\t}, callback);\r\n\t\t});\r\n\t}\r\n}\r\n\r\n\r\nmodule.exports = RunPostCSSAfterCompilationPlugin;\r\n"]}