text: const Fs = require('fs');
  const Path = require('path');
  const Sass = require('node-sass');
  
  const getComponents = () => {
    let allComponents = [];
  
    const types = ['atoms', 'molecules', 'organisms'];
  
    types.forEach((type) => {
      const allFiles = Fs.readdirSync(`src/${type}`).map((file) => ({
        input: `src/lib/${type}/${file}`,
        output: `src/lib/${file.slice(0, -4) + 'css'}`,
      }));
  
      allComponents = [...allComponents, ...allFiles];
    });
  
    return allComponents;
  };
  
  const compile = (path, fileName) => {
    const result = Sass.renderSync({
      data: Fs.readFileSync(Path.resolve(path)).toString(),
      outputStyle: 'expanded',
      outFile: 'globals.css',
      includePaths: [Path.resolve('src')],
    });
  
    Fs.writeFileSync(Path.resolve(fileName), result.css.toString());
  };
  
  compile('src/globals.scss', 'src/lib/globals.css');
  
  getComponents().forEach((component) => {
    compile(component.input, component.output);
  });
  