How to use the typed-css-modules function in typed-css-modules

To help you get started, we’ve selected a few typed-css-modules 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 Feiyang1 / awesome-typed-sass-modules / src / cli.js View on Github external
yarg.showHelp();
        return;
    }

    // If search directory doesn't exits, exit
    if (!fs.existsSync(searchDir)) {
        console.error(chalk.red(`Error: Input directory ${searchDir} doesn't exist.`));
        return;
    }

    // use foward slash. e.g. chokidar only supports glob with forward slashes
    const filesPattern = path.join(searchDir, argv.p).trim().replace(/\\/g, '/');

    const rootDir = process.cwd();

    const creator = new DtsCreator({
        rootDir,
        searchDir,
        outDir: argv.o,
        camelCase: argv.c,
        dropExtension: argv.d,
    });

    const cache = !!argv.w;

    if (!argv.w) {
        const globOptions = argv.i ? { ignore: argv.i } : null;
        glob(filesPattern, globOptions, (err, pathNames) => {
            if (err) {
                console.error(err);
                return;
            } else if (!pathNames || !pathNames.length) {
github GoogleChromeLabs / proxx / lib / css-module-types.js View on Github external
function newCreator() {
  return new DtsCreator({
    camelCase: true
  });
}
github dropbox / typed-css-modules-webpack-plugin / src / index.ts View on Github external
constructor({globPattern, postCssPlugins = cssModuleCore.defaultPlugins}: Options) {
    this.globPattern = globPattern;
    if (typeof postCssPlugins === 'function') {
      postCssPlugins = postCssPlugins(cssModuleCore.defaultPlugins);
    }
    this.dtsCreator = new DtsCreator({searchDir: __dirname, loaderPlugins: postCssPlugins});
  }

typed-css-modules

Creates .d.ts files from CSS Modules .css files

MIT
Latest version published 10 months ago

Package Health Score

73 / 100
Full package analysis

Popular typed-css-modules functions