@stylable/core
Version:
CSS for Components
16 lines • 1 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.createStylableFileProcessor = void 0;
const cached_process_file_1 = require("./cached-process-file");
const parser_1 = require("./parser");
const stylable_processor_1 = require("./stylable-processor");
const feature_1 = require("./features/feature");
function createStylableFileProcessor({ fileSystem, onProcess, resolveNamespace, cssParser = parser_1.cssParse, cache, createDiagnostics, flags = { ...feature_1.defaultFeatureFlags }, }) {
return (0, cached_process_file_1.cachedProcessFile)((from, content) => {
return new stylable_processor_1.StylableProcessor(createDiagnostics?.(from), resolveNamespace, flags).process(cssParser(content, { from }));
}, (resolvedPath) => {
return fileSystem.readFileSync(resolvedPath, 'utf8');
}, onProcess && [onProcess], cache);
}
exports.createStylableFileProcessor = createStylableFileProcessor;
//# sourceMappingURL=create-stylable-processor.js.map