How to use the @stylable/core.StylableResolver function in @stylable/core

To help you get started, we’ve selected a few @stylable/core examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github wix / stylable / packages / core-test-kit / src / generate-test-util.ts View on Github external
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 };
}