Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
outputCSSNameTemplate,
outputSources,
injectCSSRequest,
optimize,
minify,
compat,
manifest
}: BuildOptions) {
const generatorModule = generatorPath
? require(resolve(generatorPath))
: require('./default-generator');
const generator: Generator = new generatorModule.Generator();
const blacklist = new Set(['node_modules']);
const fullSrcDir = join(rootDir, srcDir);
const fullOutDir = join(rootDir, outDir);
const { result: filesToBuild } = findFiles(fs, fullSrcDir, extension, blacklist);
const assets: string[] = [];
const diagnosticsMsg: string[] = [];
const indexFileOutput: Array<{ from: string; name: string }> = [];
const nameMapping: { [key: string]: string } = {};
if (filesToBuild.length === 0) {
log('[Build]', 'No stylable files found. build skipped.');
} else {
log('[Build]', `Building ${filesToBuild.length} stylable files.`);
}
filesToBuild.forEach(filePath => {
indexFile
? generateFileIndexEntry(
filePath,
nameMapping,
log,
private handleVariants(
componentConfig: ComponentConfig,
componentDir: string,
compilation: webpack.compilation.Compilation,
builder: ComponentMetadataBuilder,
namespace: any,
depth: any
) {
if (componentConfig.variantsPath) {
const variantsDir = join(componentDir, componentConfig.variantsPath);
const { result: variants, errors } = findFiles(
compilation.inputFileSystem,
variantsDir,
'.st.css',
new Set(),
true
);
if (errors.length) {
throw new Error(
`Error while reading variants for: ${componentConfig.id} in ${variantsDir}\nOriginal Errors:\n${errors}`
);
}
variants.forEach((name: string) => {
if (!name.match(/\.st\.css/)) {
return;
}