{"id":16485792,"url":"https://github.com/creeperyang/css-content-loader","last_synced_at":"2025-10-27T12:02:51.197Z","repository":{"id":66339873,"uuid":"55772059","full_name":"creeperyang/css-content-loader","owner":"creeperyang","description":"CSS content loader for webpack","archived":false,"fork":false,"pushed_at":"2016-04-09T14:16:20.000Z","size":12,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-11T14:46:45.371Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/creeperyang.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-04-08T10:51:12.000Z","updated_at":"2016-04-11T08:10:55.000Z","dependencies_parsed_at":"2023-02-23T04:00:55.435Z","dependency_job_id":null,"html_url":"https://github.com/creeperyang/css-content-loader","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/creeperyang%2Fcss-content-loader","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/creeperyang%2Fcss-content-loader/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/creeperyang%2Fcss-content-loader/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/creeperyang%2Fcss-content-loader/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/creeperyang","download_url":"https://codeload.github.com/creeperyang/css-content-loader/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241262220,"owners_count":19936046,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-11T13:27:15.168Z","updated_at":"2025-10-27T12:02:51.141Z","avatar_url":"https://github.com/creeperyang.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# css-content-loader\n\n\u003e CSS content loader for webpack\n\n[![Build Status](https://travis-ci.org/creeperyang/css-content-loader.svg?branch=master)](https://travis-ci.org/creeperyang/css-content-loader)\n[![Coverage Status](https://coveralls.io/repos/github/creeperyang/css-content-loader/badge.svg?branch=master)](https://coveralls.io/github/creeperyang/css-content-loader?branch=master)\n[![Dependency Status](https://david-dm.org/creeperyang/css-content-loader.svg)](https://david-dm.org/creeperyang/css-content-loader)\n[![devDependency Status](https://david-dm.org/creeperyang/css-content-loader/dev-status.svg)](https://david-dm.org/creeperyang/css-content-loader#info=devDependencies)\n\n**Why this loader?** We use `style-loader` as the last loader for style files and it will insert a `\u003cstyle\u003e` or `\u003clink\u003e` tag into the html doc. In most cases, it's enough and works perfectly.\n\nHowever, what if we just want to **get the style content as string** directly? Sometimes I just want `require` the style content in code and process the string. This loader is for the *corner case*.\n\n## Install\n\n[![NPM](https://nodei.co/npm/css-content-loader.png?downloads=true\u0026downloadRank=true\u0026stars=true)](https://nodei.co/npm/css-content-loader/)\n\n## Usage\n\n[Documentation: Using loaders](http://webpack.github.io/docs/using-loaders.html)\n\n```js\nvar cssContent = require('css-content!./file.css');\n// =\u003e returns css code as string from file.css\n// cssContent is string like `body { margin: 0; }`\n\nvar cssContent2 = require('css-content!css!postcss!sass!./file.scss');\n// recommend to use with css-loader and other style loaders.\n// and css-content-loader will get the compiled css content as string.\n```\n\n### loader config\n\nCurrently no special config is needed for `css-content-loader`. It works well with `css-loader`.\n\n```js\nmodule.exports = {\n    module: {\n        loaders: [\n            { test: /\\.css$/, loader: \"css-content-loader!css-loader\" },\n            { test: /\\.png$/, loader: \"url-loader?limit=100000\" },\n            { test: /\\.jpg$/, loader: \"file-loader\" }\n        ]\n    }\n};\n```\n\n## License\n\n[MIT](http://www.opensource.org/licenses/mit-license.php)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcreeperyang%2Fcss-content-loader","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcreeperyang%2Fcss-content-loader","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcreeperyang%2Fcss-content-loader/lists"}