How to use postcss-modules-extract-imports - 1 common examples

To help you get started, we’ve selected a few postcss-modules-extract-imports 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 css-modules / css-modules-require-hook / src / extractor.js View on Github external
scopedName = typeof generateScopedName !== 'function'
      ? genericNames(generateScopedName || '[name]__[local]___[hash:base64:5]', {context})
      : generateScopedName;
  } else {
    // small fallback
    scopedName = (local, filename) => Scope.generateScopedName(local, relative(context, filename));

  const plugins = (use || [
      ? new LocalByDefault({mode})
      : LocalByDefault,
      ? new ExtractImports({createImportedName})
      : ExtractImports,
    new Scope({generateScopedName: scopedName}),
  ]).concat(new Parser({fetch})); // no pushing in order to avoid the possible mutations

  return postcss(plugins);


A CSS Modules transform to extract local aliases for inline imports

Latest version published 2 years ago

Package Health Score

71 / 100
Full package analysis

Popular postcss-modules-extract-imports functions