"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const tslib_1 = require("tslib");
const lowcode_code_generator_1 = require("@alilc/lowcode-code-generator");
const const_1 = require("./const");
const pluginFactory = (config) => {
    const cfg = Object.assign({ fileType: 'vue' }, config);
    const plugin = (pre) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
        const next = Object.assign({}, pre);
        const ir = next.ir;
        if (!ir.css) {
            return next;
        }
        next.chunks.push({
            type: lowcode_code_generator_1.ChunkType.STRING,
            fileType: cfg.fileType,
            name: const_1.VUE_CHUNK_NAME.StyleContent,
            content: ir.css,
            linkAfter: [const_1.VUE_CHUNK_NAME.StyleStart],
        });
        return next;
    });
    return plugin;
};
exports.default = pluginFactory;
//# sourceMappingURL=styles.js.map