node package manager
Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »

group-css-media-queries-loader

group-css-media-queries-loader

A group-css-media-queries loader for webpack.

npm version

Install

npm install group-css-media-queries-loader --save-dev
//or
yarn add group-css-media-queries-loader --dev

Usage

Use the loader either via your webpack config, CLI or inline.

Via webpack config (recommended)

webpack.config.js

module.exports = {
  module: {
    rules: [
      {
        test: /\.css$/,
        use: [
          'style-loader',
          'css-loader',
          'group-css-media-queries-loader'
        ]
      }
    ]
  }
}

In your application

import css_min from 'style.css';

CLI

webpack --module-bind 'css=style-loader!css-loader!group-css-media-queries-loader'

In your application

import css_min from 'style.css';

Inline

In your application

import css_min from 'style-loader!css-loader!group-css-media-queries-loader!./style.css';

Examples (for webpack 1.x): webpack.config.js

module: {
  loaders: [{
    test: /\.css$/,
    loader: 'css!group-css-media-queries'
  }]
}

In your application

var css = require('!raw!group-css-media-queries!./file.css'); // Just the CSS 
var css = require('!css!group-css-media-queries!./file.css'); // CSS with processed url(...)s