restyle-loader
restyle loader module for webpack
Last updated 3 years ago by danielvr .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install restyle-loader 
SYNC missed versions from official npm registry.

npm deps test coverage chat

restyle-loader

Updates style <link> href value with a hash to trigger a style reload

Install

npm install --save-dev restyle-loader

Usage

Documentation: Using loaders

Examples

webpack.config.js

{
  test: /\.css?$/,
  use: [
    {
      loader: "restyle-loader"
    },
    {
      loader: "file-loader",
      options: {
        name: "[name].css?[hash:8]"
      }
    }
  ]
}

Hash is required to enable HMR

bundle.js

require("./index.css");

// Bundle code here...

index.html

<!-- ... -->
<head>
  <link rel="stylesheet" type="text/css" href="css/index.css">
</head>
<!-- ... -->

after the loader runs it becomes

<!-- ... -->
<head>
  <link rel="stylesheet" type="text/css" href="css/index.css?531fdfd0">
</head>
<!-- ... -->

Maintainers


Daniel Verejan

Current Tags

  • 0.0.3                                ...           latest (3 years ago)

3 Versions

  • 0.0.3                                ...           3 years ago
  • 0.0.2                                ...           4 years ago
  • 0.0.1                                ...           4 years ago
Downloads
Today 0
This Week 1
This Month 1
Last Day 0
Last Week 0
Last Month 0
Dependencies (1)
Dev Dependencies (8)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |