Socket
Socket
Sign inDemoInstall

css-hot-loader

Package Overview
Dependencies
12
Maintainers
1
Versions
33
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.3.4 to 1.3.5

4

History.md

@@ -0,1 +1,5 @@

### 1.3.5 / 2017-12-24
- Refactor hotModuleReplacement [#27](https://github.com/shepherdwind/css-hot-loader/pull/27) by @GeorgeTaveras1231
### 1.3.3 / 2017-11-08

@@ -2,0 +6,0 @@

24

hotModuleReplacement.js
var normalizeUrl = require('normalize-url');
var srcByModuleId = Object.create(null);
var noDocument = typeof document === 'undefined';
var slice = Array.prototype.slice;
var noop = function () {}
var getCurrentScriptUrl = function(moduleId) {
var src = srcByModuleId[moduleId];
if (!src && document) {
if (!src) {
if (document.currentScript) {

@@ -50,3 +55,4 @@ src = document.currentScript.src;

var loaded = false;
[].slice.call(elements).forEach(function(el) {
slice.call(elements).forEach(function(el) {
var url = getReloadUrl(el.href, src);

@@ -74,3 +80,3 @@ if (url) {

var elements = document.querySelectorAll('link');
[].slice.call(elements).forEach(function(el) {
slice.call(elements).forEach(function(el) {
updateCss(el);

@@ -81,8 +87,10 @@ });

module.exports = function(moduleId, options) {
var getScriptSrc = getCurrentScriptUrl(moduleId);
var getScriptSrc;
if (noDocument) {
return noop;
}
getScriptSrc = getCurrentScriptUrl(moduleId);
return function() {
if (typeof document === 'undefined') {
return;
}
var src = getScriptSrc(options.fileMap);

@@ -89,0 +97,0 @@ var reloaded = reloadStyle(src);

{
"name": "css-hot-loader",
"version": "1.3.4",
"version": "1.3.5",
"description": "css hot reload work with extract-text-webpack-plugin",

@@ -5,0 +5,0 @@ "main": "index.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc