Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export function generateInfra(
config: InfraConfig,
diagnostics: Diagnostics = new Diagnostics()
): {
resolver: StylableResolver;
requireModule: RequireType;
fileProcessor: FileProcessor;
} {
const { fs, requireModule } = createMinimalFS(config);
const fileProcessor = cachedProcessFile(
(from, content) => {
const meta = process(postcss.parse(content, { from }), diagnostics);
meta.namespace = config.files[from].namespace || meta.namespace;
return meta;
},
fs,
x => x
);
const resolver = new StylableResolver(fileProcessor, requireModule);
return { resolver, requireModule, fileProcessor };
}