{"id":17958332,"url":"https://github.com/sheerun/extracted-loader","last_synced_at":"2025-05-07T13:34:41.573Z","repository":{"id":60775057,"uuid":"113692974","full_name":"sheerun/extracted-loader","owner":"sheerun","description":"It reloads extracted stylesheets extracted with ExtractTextPlugin","archived":false,"fork":false,"pushed_at":"2020-02-07T14:50:04.000Z","size":141,"stargazers_count":63,"open_issues_count":5,"forks_count":10,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-15T12:50:42.981Z","etag":null,"topics":["chameleon","css","hot-reload","loader","stylesheet","webpack"],"latest_commit_sha":null,"homepage":"","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/sheerun.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-12-09T18:48:56.000Z","updated_at":"2024-02-26T21:35:24.000Z","dependencies_parsed_at":"2022-10-04T16:16:39.304Z","dependency_job_id":null,"html_url":"https://github.com/sheerun/extracted-loader","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sheerun%2Fextracted-loader","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sheerun%2Fextracted-loader/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sheerun%2Fextracted-loader/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sheerun%2Fextracted-loader/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sheerun","download_url":"https://codeload.github.com/sheerun/extracted-loader/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252887479,"owners_count":21819908,"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":["chameleon","css","hot-reload","loader","stylesheet","webpack"],"created_at":"2024-10-29T10:59:28.247Z","updated_at":"2025-05-07T13:34:41.557Z","avatar_url":"https://github.com/sheerun.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# extracted-loader [![][npm-image]][npm-url] \u003cimg align=\"right\" width=\"200\" src=\"https://i.imgur.com/hBxPotS.png\"\u003e\n\n[npm-image]: http://img.shields.io/npm/v/extracted-loader.svg?style=flat-square\n[npm-url]: http://npmjs.org/package/extracted-loader\n\nIt hotreloads extracted stylesheets extracted with `ExtractTextPlugin`.\n\nNo configuration needed. A better [css-hot-loader](https://github.com/shepherdwind/css-hot-loader).\n\n## Use case\n\nYou want to hot reload only stylesheets, not the whole page. Great for editing dynamic views.\n\n## Installation\n\n```\nnpm install extracted-loader --save-dev\n```\n\nor\n\n```\nyarn add extracted-loader --dev \n```\n\nAnd then you can use it for example as so:\n\n```js\nconst isDev = process.env.NODE_ENV === 'development'\n\nconfig.module.rules.push({\n  test: /\\.css$/,\n  use: ['extracted-loader'].concat(ExtractTextPlugin.extract({\n    filename: isDev ? \"[name].css\" : \"[name].[contenthash].css\",\n    /* Your configuration here */\n  }))\n})\n\nconfig.plugins.push(new ExtractTextPlugin('index.css'))\n```\n\nFor hot reloading to work it is important **to not** use `[contenthash]` in development configuration.\n\n## Example use with sass\n\n```js\nconfig.module.rules.push({\n  test: /\\.(sa|sc|c)ss$/,\n  use: ['extracted-loader'].concat(ExtractTextPlugin.extract({\n    use: [\n      \"babel-loader\",\n      {\n        loader: 'css-loader',\n        options: {\n          url: true,\n          minimize: !isDev,\n          sourceMap: isDev,\n          importLoaders: 2\n        }\n      },\n      {\n        loader: 'postcss-loader',\n        options: {\n          sourceMap: isDev,\n          plugins: [\n            require('autoprefixer')({\n              /* options */\n            })\n          ]\n        }\n      },\n      {\n        loader: 'sass-loader',\n        options: {\n          sourceMap: isDev\n        }\n      }\n    ]\n  }))\n})\n\nconfig.plugins.push(new ExtractTextPlugin('index.css'))\n```\n\n## How it works\n\nBy reloading all relevant `\u003clink rel=\"stylesheet\"\u003e` when extracted text changes.\n\n## How to use with...\n\n- [next.js](https://github.com/sheerun/extracted-loader/tree/master/examples/with-next)\n\n## Contributing\n\nYes, please\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsheerun%2Fextracted-loader","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsheerun%2Fextracted-loader","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsheerun%2Fextracted-loader/lists"}