{"id":14955448,"url":"https://github.com/adrienpoly/sprockets-less-rails6","last_synced_at":"2025-10-23T13:59:02.761Z","repository":{"id":49506600,"uuid":"205649458","full_name":"adrienpoly/sprockets-less-rails6","owner":"adrienpoly","description":"Playground Rails6 application with Webpacker","archived":false,"fork":false,"pushed_at":"2021-06-16T09:17:37.000Z","size":8144,"stargazers_count":8,"open_issues_count":22,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-14T11:14:13.492Z","etag":null,"topics":["purgecss","rails6","sprocketless","webpacker"],"latest_commit_sha":null,"homepage":"https://sprockets-less-rails6.herokuapp.com/","language":"Ruby","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/adrienpoly.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}},"created_at":"2019-09-01T08:28:04.000Z","updated_at":"2021-07-24T06:53:23.000Z","dependencies_parsed_at":"2022-09-03T12:30:29.051Z","dependency_job_id":null,"html_url":"https://github.com/adrienpoly/sprockets-less-rails6","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/adrienpoly%2Fsprockets-less-rails6","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adrienpoly%2Fsprockets-less-rails6/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adrienpoly%2Fsprockets-less-rails6/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adrienpoly%2Fsprockets-less-rails6/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/adrienpoly","download_url":"https://codeload.github.com/adrienpoly/sprockets-less-rails6/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":234737856,"owners_count":18879180,"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":["purgecss","rails6","sprocketless","webpacker"],"created_at":"2024-09-24T13:11:10.362Z","updated_at":"2025-09-30T13:30:48.361Z","avatar_url":"https://github.com/adrienpoly.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Sprockets Less Playground\n\nLooking as some optimisation when moving all assets to Webpacker\n\n## Part 1 : Inline Critical CSS with Purges CSS\n\nRead more [dev.to](https://dev.to/adrienpoly/critical-css-with-rails-and-webpacker-sprocketsless-part-1-2bck)\n\nKey take away the PostCSS config\n\n```js\n// postcss.config.js\n\nconst environment = ctx =\u003e ({\n  plugins: [\n    require(\"postcss-import\"),\n    require(\"postcss-flexbugs-fixes\"),\n    require(\"postcss-preset-env\")({\n      autoprefixer: {\n        flexbox: \"no-2009\"\n      },\n      stage: 3\n    }),\n    purgeCss(ctx)\n  ]\n});\n\nconst purgeCss = ({ file }) =\u003e {\n  return require(\"@fullhuman/postcss-purgecss\")({\n    content: htmlFilePatterns(file.basename),\n    defaultExtractor: content =\u003e content.match(/[A-Za-z0-9-_:/]+/g) || [],\n    extractors: [\n      {\n        extractor: require(\"purgecss-from-html\"),\n        extensions: [\"html\"]\n      }\n    ]\n  });\n};\n\nconst htmlFilePatterns = filename =\u003e {\n  switch (filename) {\n    case \"critical.scss\":\n      return [\n        \"./app/views/pages/index.html.erb\",\n        \"./app/views/shared/_navbar.html.erb\",\n        \"./app/views/layouts/application.html.erb\"\n      ];\n    default:\n      return [\n        \"./app/**/*.html.erb\",\n        \"./config/initializers/simple_form_bootstrap.rb\",\n        \"./app/helpers/**/*.rb\",\n        \"./app/javascript/**/*.js\"\n      ];\n  }\n};\n\nmodule.exports = ctx =\u003e environment(ctx);\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadrienpoly%2Fsprockets-less-rails6","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fadrienpoly%2Fsprockets-less-rails6","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadrienpoly%2Fsprockets-less-rails6/lists"}