Initial commit
commit
a73b1e68bc
|
@ -0,0 +1 @@
|
|||
node_modules
|
|
@ -0,0 +1,14 @@
|
|||
# style loader for webpack
|
||||
|
||||
## Usage
|
||||
|
||||
``` javascript
|
||||
require("style!./file.css");
|
||||
// => add rules in file.css to document
|
||||
```
|
||||
|
||||
Does nothing in node.js.
|
||||
|
||||
## License
|
||||
|
||||
MIT (http://www.opensource.org/licenses/mit-license.php)
|
|
@ -0,0 +1 @@
|
|||
module.exports = function() {}
|
|
@ -0,0 +1,14 @@
|
|||
/*
|
||||
MIT License http://www.opensource.org/licenses/mit-license.php
|
||||
Author Tobias Koppers @sokra
|
||||
*/
|
||||
module.exports = function(cssCode) {
|
||||
var styleElement = document.createElement("style");
|
||||
styleElement.type = "text/css";
|
||||
if (styleElement.styleSheet) {
|
||||
styleElement.styleSheet.cssText = cssCode;
|
||||
} else {
|
||||
styleElement.appendChild(document.createTextNode(cssCode));
|
||||
}
|
||||
document.getElementsByTagName("head")[0].appendChild(styleElement);
|
||||
}
|
|
@ -0,0 +1,13 @@
|
|||
/*
|
||||
MIT License http://www.opensource.org/licenses/mit-license.php
|
||||
Author Tobias Koppers @sokra
|
||||
*/
|
||||
var path = require("path");
|
||||
module.exports = function(content) {
|
||||
var options = this;
|
||||
var result = [];
|
||||
var loaderSign = this.request.indexOf("!");
|
||||
var rawCss = this.request.substr(loaderSign); // including leading "!"
|
||||
return "require(" + JSON.stringify(path.join(__dirname, "addStyle")) + ")"+
|
||||
"(require(" + JSON.stringify(rawCss) + "))";
|
||||
}
|
|
@ -0,0 +1,16 @@
|
|||
{
|
||||
"name": "style-loader",
|
||||
"version": "0.1.0",
|
||||
"author": "Tobias Koppers @sokra",
|
||||
"description": "style loader module for webpack",
|
||||
"dependencies": {
|
||||
"raw-loader": "0.1.x"
|
||||
},
|
||||
"licenses": [
|
||||
{
|
||||
"type": "MIT",
|
||||
"url": "http://www.opensource.org/licenses/mit-license.php"
|
||||
}
|
||||
],
|
||||
"license": "MIT"
|
||||
}
|
|
@ -0,0 +1,3 @@
|
|||
module.exports = function(content) {
|
||||
return "";
|
||||
}
|
|
@ -0,0 +1,3 @@
|
|||
module.exports = function(content) {
|
||||
return content;
|
||||
}
|
Loading…
Reference in New Issue