critical-style-loader
Advanced tools
Comparing version 2.0.0-beta.14 to 2.0.0
@@ -29,3 +29,3 @@ "use strict"; | ||
var path = loaderUtils.stringifyRequest(this, "!!".concat(request)); | ||
return "\n var content = require(".concat(path, ");\n var hashCode = require('critical-style-loader/lib/hashCode.js');\n\n // function hashCode(hashString) {\n // var hash = 0;\n // var chr;\n\n // for (var i = 0; i < hashString.length; i += 1) {\n // chr = hashString.charCodeAt(i);\n // hash = (hash << 5) - hash + chr;\n // hash |= 0; // Convert to 32bit integer\n // }\n\n // return hash;\n // }\n\n if (\n 'undefined' !== typeof window &&\n 'undefined' !== typeof document\n ) {\n var preRendered = content.some(function(module) {\n var css = module[1];\n var id = hashCode(css);\n\n if (window.").concat(GLOBAL_HOOK, " && window.").concat(GLOBAL_HOOK, "[id]) {\n console.log('prerendered!', css, id);\n return true;\n }\n\n return false;\n });\n\n if (preRendered) {\n module.exports = '/* CSS output skipped for ' +\n module.id +\n ' prerendered server-side */';\n } else {\n module.exports = content;\n }\n } else {\n if (typeof content === 'string') {\n content = [[module.id, content, '']];\n }\n\n // Export CSS Modules\n if (content.locals) {\n module.exports = content.locals;\n }\n\n // Provide getter for raw CSS.\n module.exports.getCss = function() {\n return content;\n };\n }\n "); | ||
return "\n var content = require(".concat(path, ");\n var hashCode = require('critical-style-loader/lib/hashCode.js');\n\n if (\n 'undefined' !== typeof window &&\n 'undefined' !== typeof document\n ) {\n var preRendered = content.some(function(module) {\n var css = module[1];\n var id = hashCode(css);\n\n if (window.").concat(GLOBAL_HOOK, " && window.").concat(GLOBAL_HOOK, "[id]) {\n return true;\n }\n\n return false;\n });\n\n if (preRendered) {\n module.exports = '/* CSS output skipped for ' +\n module.id +\n ' prerendered server-side */';\n } else {\n module.exports = content;\n }\n } else {\n if (typeof content === 'string') {\n content = [[module.id, content, '']];\n }\n\n // Export CSS Modules\n if (content.locals) {\n module.exports = content.locals;\n }\n\n // Provide getter for raw CSS.\n module.exports.getCss = function() {\n return content;\n };\n }\n "); | ||
}; |
{ | ||
"name": "critical-style-loader", | ||
"version": "2.0.0-beta.14", | ||
"version": "2.0.0", | ||
"description": "A webpack loader for rendering critical path CSS on the server with utilities to avoid client side style-loader style duplications.", | ||
@@ -42,3 +42,3 @@ "keywords": [ | ||
"dependencies": { | ||
"loader-utils": "^1.1.0" | ||
"loader-utils": "^2.0.0" | ||
}, | ||
@@ -45,0 +45,0 @@ "devDependencies": { |
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
1
12796
162
+ Addedjson5@2.2.3(transitive)
+ Addedloader-utils@2.0.4(transitive)
- Removedjson5@1.0.2(transitive)
- Removedloader-utils@1.4.2(transitive)
- Removedminimist@1.2.8(transitive)
Updatedloader-utils@^2.0.0