{"id":18314322,"url":"https://github.com/agrublev/webpack-blocks-assets","last_synced_at":"2025-10-11T03:26:53.850Z","repository":{"id":44089449,"uuid":"200950022","full_name":"agrublev/webpack-blocks-assets","owner":"agrublev","description":null,"archived":false,"fork":false,"pushed_at":"2023-01-07T08:29:16.000Z","size":679,"stargazers_count":0,"open_issues_count":12,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-09T12:43:03.895Z","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/agrublev.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":"2019-08-07T01:35:06.000Z","updated_at":"2019-08-07T01:55:12.000Z","dependencies_parsed_at":"2023-02-06T16:31:49.292Z","dependency_job_id":null,"html_url":"https://github.com/agrublev/webpack-blocks-assets","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/agrublev/webpack-blocks-assets","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/agrublev%2Fwebpack-blocks-assets","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/agrublev%2Fwebpack-blocks-assets/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/agrublev%2Fwebpack-blocks-assets/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/agrublev%2Fwebpack-blocks-assets/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/agrublev","download_url":"https://codeload.github.com/agrublev/webpack-blocks-assets/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/agrublev%2Fwebpack-blocks-assets/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279006109,"owners_count":26084026,"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","status":"online","status_checked_at":"2025-10-11T02:00:06.511Z","response_time":55,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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-11-05T16:31:49.149Z","updated_at":"2025-10-11T03:26:53.822Z","avatar_url":"https://github.com/agrublev.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# webpack-blocks - assets\n\n[![Gitter chat](https://badges.gitter.im/webpack-blocks.svg)](https://gitter.im/webpack-blocks)\n[![NPM Version](https://img.shields.io/npm/v/@webpack-blocks/assets.svg)](https://www.npmjs.com/package/@webpack-blocks/assets)\n\nThis is the `assets` block providing configuration for the style loader, file loader, URL loader and\nfriends.\n\n## Usage\n\n\u003c!-- prettier-ignore-start --\u003e\n```js\nconst { createConfig, match } = require('@webpack-blocks/webpack')\nconst { css, file, url } = require('@webpack-blocks/assets')\n\nmodule.exports = createConfig([\n  css(), // or use `match()` to apply it to other files than *.css\n\n  // will copy font files to build directory and link to them\n  match(['*.eot', '*.ttf', '*.woff', '*.woff2'], [\n    file()\n  ]),\n\n  // will load images up to 10KB as data URL\n  match(['*.gif', '*.jpg', '*.jpeg', '*.png', '*.svg', '*.webp'], [\n    url({ limit: 10000 })\n  ])\n])\n```\n\u003c!-- prettier-ignore-end --\u003e\n\nIn order to use CSS modules:\n\n```js\nconst { createConfig, match } = require('@webpack-blocks/webpack')\nconst { css } = require('@webpack-blocks/assets')\n\nmodule.exports = createConfig([\n  match(\n    ['*.css', '!*node_modules*'],\n    [\n      css.modules({\n        localIdentName: '[name]--[local]--[hash:base64:5]'\n      })\n    ]\n  )\n])\n```\n\n## API\n\n### css(options: ?object)\n\nWill match `*.css` by default if not used with `match()`. You can pass all\n[`css-loader` options](https://github.com/webpack-contrib/css-loader). With `styleLoader` you can\npass options to the [`style-loader`](https://github.com/webpack-contrib/style-loader), setting it to\n`false` will remove the `style-loader` from loaders.\n\n### css.modules(options: ?object)\n\nWill match `*.css` by default if not used with `match()`. You can pass all\n[`css-loader` options](https://github.com/webpack-contrib/css-loader).\n\nThe difference to `css()` is that it sets the following `css-loader` options by default:\n\n- `modules: true`\n- `importLoaders` defaults to `1`\n- `localIdentName` defaults to `'[name]--[local]--[hash:base64:5]'` in development and\n  `'[hash:base64:10]'` in production\n\n### file(options: ?object)\n\nMust be used with `match()`. You can pass all\n[`file-loader` options](https://github.com/webpack-contrib/file-loader).\n\n### url(options: ?object)\n\nMust be used with `match()`. You can pass all\n[`url-loader` options](https://github.com/webpack-contrib/url-loader). We strongly recommend setting\na `limit` to prevent huge files to be encoded as a data URL.\n\n## webpack-blocks\n\nCheck out the\n\n👉 [Main documentation](https://github.com/andywer/webpack-blocks)\n\nReleased under the terms of the MIT license.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fagrublev%2Fwebpack-blocks-assets","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fagrublev%2Fwebpack-blocks-assets","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fagrublev%2Fwebpack-blocks-assets/lists"}