How to use gatsby-1-config-css-modules - 1 common examples

To help you get started, we’ve selected a few gatsby-1-config-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 gatsbyjs / gatsby / packages / gatsby / src / utils / webpack.config.js View on Github external
case `develop-html`:
        // We don't deal with CSS at all when building the HTML.
        // The 'null' loader is used to prevent 'module not found' errors.
        // On the other hand CSS modules loaders are necessary.

        config.loader(`css`, {
          test: /\.css$/,
          exclude: /\.module\.css$/,
          loader: `null`,
        })

        // CSS modules
        config.loader(`cssModules`, {
          test: /\.module\.css$/,
          loader: extractTextPlugin(stage).extract(`style`, [
            cssModulesConfig(stage),
            `postcss`,
          ]),
        })

        return config

      case `build-javascript`:
        // we don't deal with css at all when building the javascript.  but
        // still need to process the css so offline-plugin knows about the
        // various assets referenced in your css.
        //
        // It's also necessary to process CSS Modules so your JS knows the
        // classNames to use.

        config.loader(`css`, {
          test: /\.css$/,

gatsby-1-config-css-modules

CSS Modules configuration for Gatsby v1 plugins

MIT
Latest version published 7 years ago

Package Health Score

72 / 100
Full package analysis

Popular gatsby-1-config-css-modules functions