# extracted-loader

> Reloads stylesheets extracted with with ExtractTextPlugin

Latest version **1.0.7** (published 2018-03-13) · MIT license · 0 weekly downloads

## Install

```sh
npm install extracted-loader
pnpm add extracted-loader
yarn add extracted-loader
bun add extracted-loader
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.7 |
| Published | 2018-03-13 |
| First published | 2017-12-09 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 3.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 63 |
| Author | sheerun |
| Maintainers | sheerun |
| Keywords | webpack, loader, css, scss, styles, stylesheets, hotreload, next.js |

## Links

- npm: https://www.npmjs.com/package/extracted-loader
- Repository: https://github.com/sheerun/extracted-loader
- Issues: https://github.com/sheerun/extracted-loader/issues
- npm.io page: https://npm.io/package/extracted-loader

## Alternatives

- [style-dictionary](https://npm.io/package/style-dictionary.md) — 2.0M weekly downloads
- [postcss-merge-idents](https://npm.io/package/postcss-merge-idents.md) — 1.7M weekly downloads
- [@fontsource/noto-sans](https://npm.io/package/@fontsource/noto-sans.md) — 93.0K weekly downloads
- [uglifycss](https://npm.io/package/uglifycss.md) — 71.6K weekly downloads
- [mat4-interpolate](https://npm.io/package/mat4-interpolate.md) — 23.3K weekly downloads

## Recent versions

- 1.0.7 (latest) — 2018-03-13
- 1.0.6 — 2018-02-18
- 1.0.5 — 2018-02-18
- 1.0.4 — 2018-01-24
- 1.0.3 — 2017-12-12
- 1.0.1 — 2017-12-09
- 1.0.0 — 2017-12-09

## README

# extracted-loader [![][npm-image]][npm-url] <img align="right" width="200" src="https://i.imgur.com/hBxPotS.png">

[npm-image]: http://img.shields.io/npm/v/extracted-loader.svg?style=flat-square
[npm-url]: http://npmjs.org/package/extracted-loader

It hotreloads extracted stylesheets extracted with `ExtractTextPlugin`.

No configuration needed. A better [css-hot-loader](https://github.com/shepherdwind/css-hot-loader).

## Use case

You want to hot reload only stylesheets, not the whole page. Great for editing dynamic views.

## Installation

```
npm install extracted-loader --save-dev
```

or

```
yarn add extracted-loader --dev 
```

And then you can use it for example as so:

```js
config.module.rules.push({
  test: /\.css$/,
  use: ['extracted-loader'].concat(ExtractTextPlugin.extract({
    /* Your configuration here */
  }))
})

config.plugins.push(new ExtractTextPlugin('index.css'))
```


## Example use with sass

```js
config.module.rules.push({
  test: /\.(sa|sc|c)ss$/,
  use: ['extracted-loader'].concat(ExtractTextPlugin.extract({
    use: [
      "babel-loader",
      {
        loader: 'css-loader',
        options: {
          url: true,
          minimize: !dev,
          sourceMap: dev,
          importLoaders: 2
        }
      },
      {
        loader: 'postcss-loader',
        options: {
          sourceMap: dev,
          plugins: [
            require('autoprefixer')({
              /* options */
            })
          ]
        }
      },
      {
        loader: 'sass-loader',
        options: {
          sourceMap: dev
        }
      }
    ]
  }))
})

config.plugins.push(new ExtractTextPlugin('index.css'))
```

## How it works

By reloading all relevant `<link rel="stylesheet">` when extracted text changes.

## How to use with...

- [next.js](https://github.com/sheerun/extracted-loader/tree/master/examples/with-next)

## Contributing

Yes, please

## License

MIT

---
_Source: https://npm.io/package/extracted-loader · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
