{"id":19936231,"url":"https://github.com/igitscor/critical-webpack-plugin","last_synced_at":"2025-10-11T06:37:01.118Z","repository":{"id":57210732,"uuid":"83429073","full_name":"iGitScor/critical-webpack-plugin","owner":"iGitScor","description":"Webpack wrapper for critical css extraction","archived":false,"fork":false,"pushed_at":"2017-05-02T08:13:53.000Z","size":73,"stargazers_count":3,"open_issues_count":5,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-11-04T04:21:07.253Z","etag":null,"topics":["critical-css","firstpr-friendly","webpack"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/iGitScor.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-02-28T12:21:36.000Z","updated_at":"2019-03-19T15:17:17.000Z","dependencies_parsed_at":"2022-08-31T04:01:34.139Z","dependency_job_id":null,"html_url":"https://github.com/iGitScor/critical-webpack-plugin","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iGitScor%2Fcritical-webpack-plugin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iGitScor%2Fcritical-webpack-plugin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iGitScor%2Fcritical-webpack-plugin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iGitScor%2Fcritical-webpack-plugin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/iGitScor","download_url":"https://codeload.github.com/iGitScor/critical-webpack-plugin/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224362068,"owners_count":17298632,"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":["critical-css","firstpr-friendly","webpack"],"created_at":"2024-11-12T23:24:24.254Z","updated_at":"2025-10-11T06:36:56.081Z","avatar_url":"https://github.com/iGitScor.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Critical css Webpack plugin\n\n[![Build Status][build-badge]][build]\n[![codecov][codecoverage-badge]][codecoverage]\n![Node dependency][node-badge]\n[![Dependencies][dependencyci-badge]][dependencyci]\n[![dependencies Status][dependencies-badge]][dependencies]\n[![devDependencies Status][devDependencies-badge]][devDependencies]\n[![MIT License][license-badge]][LICENSE]\n\n\u003e Webpack wrapper for critical css generation\n\nExtract critical css from html file, html input or remote URL to load CSS above the fold.\n\n## Installing\n\n```shell\nnpm i critical-webpack-plugin\n```\n\n### Getting started in webpack\n\n**Require `critical-webpack-plugin`**\n```javascript\nvar CriticalWebpackPlugin = require('critical-webpack-plugin')\n```\n\nAdd the plugin to your plugin list\n```javascript\nvar config = {\n  plugins: [\n    new CriticalWebpackPlugin({\n      base: 'test',\n      src: 'index.html',\n      dest: '../build/main.css',\n      css: ['node_modules/normalize.css/normalize.css'],\n      width: 480,\n      height: 800,\n    })\n  ]\n}\n```\n\n### Configuration\n\nSee [critical package](https://www.npmjs.com/package/critical) for options and [webpack configuration files](workflow_test) to see implementation.\n\n#### Fetch content\n\nThis plugin allows to fetch remotely the content of a web page.\n\nExample:\n```javascript\nconst options = {\n  src: 'http://iscor.me',\n  dest: '../build/main.css',\n  css: ['node_modules/normalize.css/normalize.css'],\n  width: 480,\n  height: 800,\n};\n```\n\n**As this plugin is a wrapper, the critical library seems to not accept well a remote url, but the process is done normally.**\n\n## Developing\n\n```shell\ngit clone https://github.com/{your fork}/critical-webpack-plugin.git\ncd critical-webpack-plugin/\nnpm install\n```\n\nReplace `{your fork}` by your github username.\n\n## Contributing\n\nIf you'd like to contribute, please fork the repository and use a feature\nbranch. All contributions are welcome. Please make a pull request and make sure things still pass after running `npm test`.\nEnsure you've read the [contribution guidelines](CONTRIBUTING.md) for more information and respect the [code of conduct](CODE_OF_CONDUCT.md)\n\n### Contributors\n\nThanks goes to these wonderful people ([emoji key](https://github.com/kentcdodds/all-contributors#emoji-key)):\n\n\u003c!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section --\u003e\n| [\u003cimg src=\"https://avatars3.githubusercontent.com/u/2276944?v=3\" width=\"100px;\"/\u003e\u003cbr /\u003e\u003csub\u003eSebastien Correaud\u003c/sub\u003e](http://twitter.com/iTweetScor)\u003cbr /\u003e🚇 [💻](https://github.com/iGitScor/critical-webpack-plugin/commits?author=iGitScor) [📖](https://github.com/iGitScor/critical-webpack-plugin/commits?author=iGitScor) [⚠️](https://github.com/iGitScor/critical-webpack-plugin/commits?author=iGitScor) |\n| :---: |\n\u003c!-- ALL-CONTRIBUTORS-LIST:END --\u003e\n\nThis project follows the [all-contributors](https://github.com/kentcdodds/all-contributors) specification. Contributions of any kind welcome!\n\n## Licensing\n\nThe code in this project is licensed under MIT license.\n\n[build-badge]: https://img.shields.io/travis/iGitScor/critical-webpack-plugin.svg?style=flat-square\n[build]: https://travis-ci.org/iGitScor/critical-webpack-plugin\n[codecoverage-badge]: https://codecov.io/gh/iGitScor/critical-webpack-plugin/branch/master/graph/badge.svg?style=flat-square\n[codecoverage]: https://codecov.io/gh/iGitScor/critical-webpack-plugin\n[dependencyci-badge]: https://dependencyci.com/github/iGitScor/critical-webpack-plugin/badge?style=flat-square\n[dependencyci]: https://dependencyci.com/github/iGitScor/critical-webpack-plugin\n[dependencies-badge]: https://david-dm.org/iGitScor/critical-webpack-plugin/status.svg?style=flat-square\n[dependencies]: https://david-dm.org/iGitScor/critical-webpack-plugin\n[devDependencies-badge]: https://david-dm.org/iGitScor/critical-webpack-plugin/dev-status.svg?style=flat-square\n[devDependencies]: https://david-dm.org/iGitScor/critical-webpack-plugin?type=dev\n[node-badge]: https://img.shields.io/node/v/critical-webpack-plugin.svg?style=flat-square\n[license-badge]: https://img.shields.io/npm/l/critical-webpack-plugin.svg?style=flat-square\n[license]: https://github.com/iGitScor/critical-webpack-plugin/blob/master/LICENSE\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Figitscor%2Fcritical-webpack-plugin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Figitscor%2Fcritical-webpack-plugin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Figitscor%2Fcritical-webpack-plugin/lists"}