isomorphic-style-loader-react18
Version:
CSS style loader for Webpack optimized for critical path CSS rendering and isomorphic web apps
20 lines (13 loc) • 1.65 kB
JavaScript
/*! Isomorphic Style Loader | MIT License | https://github.com/kriasoft/isomorphic-style-loader */
;
var _require = require('loader-utils'),
stringifyRequest = _require.stringifyRequest;
module.exports = function loader() {};
module.exports.pitch = function pitch(request) {
if (this.cacheable) {
this.cacheable();
}
var insertCss = require.resolve('./insertCss.js');
return "\n var refs = 0;\n var css = require(" + stringifyRequest(this, "!!" + request) + ");\n var css_default = css.default || css;\n var insertCss = require(" + stringifyRequest(this, "!" + insertCss) + ");\n var content = typeof css_default === 'string' ? [[module.id, css_default, '']] : css_default;\n\n exports = module.exports = css_default.locals || {};\n exports._getContent = function() { return content; };\n exports._getCss = function() { return '' + css_default; };\n exports._insertCss = function(options) { return insertCss(content, options) };\n\n // Hot Module Replacement\n // https://webpack.github.io/docs/hot-module-replacement\n // Only activated in browser context\n if (module.hot && typeof window !== 'undefined' && window.document) {\n var removeCss = function() {};\n module.hot.accept(" + stringifyRequest(this, "!!" + request) + ", function() {\n css = require(" + stringifyRequest(this, "!!" + request) + ");\n content = typeof css === 'string' ? [[module.id, css, '']] : css;\n removeCss = insertCss(content, { replace: true });\n });\n module.hot.dispose(function() { removeCss(); });\n }\n ";
};
//# sourceMappingURL=index.js.map