0.0.3 • Published 7 years ago

restyle-loader v0.0.3

Weekly downloads
21
License
MIT
Repository
github
Last release
7 years ago

npm deps test coverage chat

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

npm install --save-dev restyle-loader

Documentation: Using loaders

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>
<!-- ... -->
0.0.3

7 years ago

0.0.2

7 years ago

0.0.1

7 years ago