Package Exports
- css-loader
- css-loader/package.json
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (css-loader) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
css loader for webpack
Usage
var css = require("css!./file.css");
// => returns css code from file.css, resolves imports and url(...)
css code will be minimized if specified by the module system.
@import
will be required with this css loader.
url(...)
will be required. You should define useful loaders by config.
Good loaders to require these files is the file-loader and the url-loader.
Example config
This webpack config can load css files, embed small png images as Data Urls and jpg images as files.
module.exports = {
module: {
loaders: {
{ test: /\.css/, loader: "style-loader!css-loader" },
{ test: /\.png/, loader: "url-loader?limit=100000&minetype=image/png" },
{ test: /\.jpg/, loader: "file-loader" }
}
}
};