UNPKG

944 BJavaScriptView Raw
1/*
2 MIT License http://www.opensource.org/licenses/mit-license.php
3 Author Tobias Koppers @sokra
4*/
5var loaderUtils = require("loader-utils"),
6 path = require("path");
7module.exports = function() {};
8module.exports.pitch = function(remainingRequest) {
9 this.cacheable && this.cacheable();
10 return [
11 "// style-loader: Adds some reference to a css file to the DOM by adding a <link> tag",
12 "var update = require(" + JSON.stringify("!" + path.join(__dirname, "addStyleUrl.js")) + ")(",
13 "\trequire(" + loaderUtils.stringifyRequest(this, "!!" + remainingRequest) + ")",
14 ");",
15 "// Hot Module Replacement",
16 "if(module.hot) {",
17 "\tmodule.hot.accept(" + loaderUtils.stringifyRequest(this, "!!" + remainingRequest) + ", function() {",
18 "\t\tupdate(require(" + loaderUtils.stringifyRequest(this, "!!" + remainingRequest) + "));",
19 "\t});",
20 "\tmodule.hot.dispose(function() { update(); });",
21 "}"
22 ].join("\n");
23};