
Security News
Crates.io Implements Trusted Publishing Support
Crates.io adds Trusted Publishing support, enabling secure GitHub Actions-based crate releases without long-lived API tokens.
webpack-extract-css-hot-reload
Advanced tools
This simple loader was created to hot reload css files which have been extracted with extract-text-webpack-plugin
. Based on css-hot-loader.
First install the package from npm
$ npm install webpack-extract-css-hot-reload --save-dev
Update your webpack.config.ts
. For example
module: {
rules: [
{
test: /\.css$/,
loader: ['webpack-extract-css-hot-reload'].concat(ExtractTextPlugin.extract([
{
loader: 'css-loader',
}, {
loader: 'postcss-loader',
},
]) as any),
},
]
}
NOTE: webpack-extract-css-hot-reload
should be defined before extract-text-webpack-plugin
.
Tag the stylesheets which need hot reloading with data-hot
.
index.html
<!DOCTYPE html>
<html>
<head>
<!-- Roboto font -->
<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">
<!-- Own styling -->
<!-- This stylesheet needs to hot reload -->
<link rel="stylesheet" href="build/styles.css" data-hot>
</head>
<body>
...
</body>
</html>
That's all! You're good to go. :)
If you don't like data-hot
for tagging hot reloadable content, then you can pass a custom HTML attribute. For example 'webpack-extract-css-hot-reload?selector=data-lukewarm'
.
MIT License
FAQs
CSS hot reload for extract-text-webpack-plugin
We found that webpack-extract-css-hot-reload demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Crates.io adds Trusted Publishing support, enabling secure GitHub Actions-based crate releases without long-lived API tokens.
Research
/Security News
Undocumented protestware found in 28 npm packages disrupts UI for Russian-language users visiting Russian and Belarusian domains.
Research
/Security News
North Korean threat actors deploy 67 malicious npm packages using the newly discovered XORIndex malware loader.