How to use the @stylable/core.makeAbsolute 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 / webpack-plugin / src / stylable-parser.ts View on Github external
.forEach(asset => {
                const absPath = makeAbsolute(
                    asset,
                    (this.compilation as any).options.context,
                    path.dirname(state.module.resource)
                );
                state.module.buildInfo.fileDependencies.add(absPath);
                state.module.addDependency(new StylableAssetDependency(absPath));
            });
github wix / stylable / packages / webpack-plugin / src / stylable-generator.ts View on Github external
const onUrl = (node: any) => {
            if (isAsset(node.url)) {
                const resourcePath = makeAbsolute(node.url, root, moduleDir);
                const module = this.compilation.modules.find(_ => _.resource === resourcePath);
                if (module) {
                    replacements.push(module);
                    this.rewriteUrl(node, replacements.length - 1);
                } else {
                    node.url = resourcePath;
                    this.compilation.warnings.push(`Stylable missing asset: ${resourcePath}`);
                }
            }
        };
        outputAst.walkDecls((decl: postcss.Declaration) =>