{"version":3,"sources":["jsdelivr-header.js","/npm/combine-css-webpack-plugin@0.0.1/index.js"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA,ACNA,IAAI,EAAI,QAAQ,UACZ,KAAO,QAAQ,QACf,GAAK,QAAQ,MACb,SAAW,QAAQ,aAEvB,SAAS,cAAc,GACnB,KAAK,QAAU,CACnB,CACA,cAAc,UAAU,MAAQ,SAAU,GACtC,IAEI,EAFA,EAAO,KACP,EAAU,EAAK,QAEnB,EAAS,OAAO,QAAQ,SAAU,EAAa,GAC3C,IAAK,EAAQ,OACT,OAAO,IAEX,EAAa,EAAK,YAAY,EAAQ,QACtC,GACJ,IACA,EAAS,OAAO,QAAQ,SAAU,EAAa,GAC3C,IAAI,EAAe,KAAK,SAAS,EAAY,QAAQ,OAAO,KAAM,EAAQ,QACvE,EAAQ,YACP,GAAa,IAAI,UAAW,OAAO,GAAY,QAEnD,EAAY,OAAO,GAAgB,CAC/B,OAAQ,WACJ,OAAO,CACX,EACA,KAAM,WACF,OAAO,EAAW,MACtB,GAGJ,GACJ,GACJ,EACA,cAAc,UAAU,YAAc,SAAU,GAM5C,IALA,IAGI,EAAO,EAAc,EAHrB,EAAY,sBACZ,EAAa,qBACb,EAAc,GAAG,aAAa,EAAY,QAE1C,EAAiB,GACb,EAAQ,EAAU,KAAK,IAC3B,KAAQ,EAAe,EAAW,KAAK,EAAM,KAAM,CAC/C,EAAW,KAAK,QAAQ,KAAK,QAAQ,GAAa,EAAa,IAC/D,IACI,GAAkB,GAAG,aAAa,EAAU,QAAU,IAC1D,CAAE,MAAO,GACT,CACJ,CAEJ,OAAO,EAAiB,CAC5B,EACA,OAAO,QAAU","file":"/npm/combine-css-webpack-plugin@0.0.1/index.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/combine-css-webpack-plugin@0.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","var _ = require('lodash');\nvar path = require('path');\nvar fs = require('fs');\nvar CleanCSS = require('clean-css');\n\nfunction CSSCombPlugin(opts) {\n    this.options = opts;\n}\nCSSCombPlugin.prototype.apply = function (compiler) {\n    var self = this;\n    var options = self.options;\n    var cssContent;\n    compiler.plugin('make', function (compilation, callback) {\n        if (!options.source) {\n            return callback();\n        }\n        cssContent = self.cssCombFile(options.source);\n        callback();\n    });\n    compiler.plugin('emit', function (compilation, callback) {\n        var relativePath = path.relative(compilation.options.output.path, options.target);\n        if(options.useMinify){\n            cssContent = new CleanCSS().minify(cssContent).styles;\n        }\n        compilation.assets[relativePath] = {\n            source: function () {\n                return cssContent;\n            },\n            size: function () {\n                return cssContent.length;\n            }\n        };\n\n        callback();\n    });\n};\nCSSCombPlugin.prototype.cssCombFile = function (sourcePath) {\n    var commetReg = /\\/\\*\\*?([^]+?)\\*\\//g;\n    var requireReg = /@require\\s+(.+)\\s/g;\n    var fileContent = fs.readFileSync(sourcePath, 'utf8');\n    var match, requireMatch, filepath;\n    var requireContent = '';\n    while ((match = commetReg.exec(fileContent))) {\n        while ((requireMatch = requireReg.exec(match[0]))) {\n            filepath = path.resolve(path.dirname(sourcePath), requireMatch[1]);\n            try {\n                requireContent += fs.readFileSync(filepath, 'utf8') + '\\n';\n            } catch (e) {\n            }\n        }\n    }\n    return requireContent + fileContent;\n};\nmodule.exports = CSSCombPlugin;"]}