{"id":17233668,"url":"https://github.com/anthonyshort/css-bundler","last_synced_at":"2025-03-26T00:43:16.690Z","repository":{"id":66565288,"uuid":"11685789","full_name":"anthonyshort/css-bundler","owner":"anthonyshort","description":"Bundle a CSS file and all of its assets into a single directory","archived":false,"fork":false,"pushed_at":"2018-01-31T07:35:48.000Z","size":168,"stargazers_count":1,"open_issues_count":1,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-03T13:03:34.383Z","etag":null,"topics":[],"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/anthonyshort.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":"2013-07-26T13:01:30.000Z","updated_at":"2014-02-05T04:42:37.000Z","dependencies_parsed_at":"2023-02-22T16:15:19.063Z","dependency_job_id":null,"html_url":"https://github.com/anthonyshort/css-bundler","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anthonyshort%2Fcss-bundler","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anthonyshort%2Fcss-bundler/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anthonyshort%2Fcss-bundler/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anthonyshort%2Fcss-bundler/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/anthonyshort","download_url":"https://codeload.github.com/anthonyshort/css-bundler/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245568578,"owners_count":20636803,"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-15T05:25:36.592Z","updated_at":"2025-03-26T00:43:16.678Z","avatar_url":"https://github.com/anthonyshort.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# css-bundler\n\nBundle a CSS file and all of its assets into a single directory. This means you don't\nhave to worry about file paths. If you separate you CSS into components, you might\nrun into this problem. You don't want to have to worry about dozens of component\nfolders and paths.\n\n### Install\n\n    npm install -g css-bundler\n\n### Command Line\n\n    css-bundler {input} {output}\n\n### Grunt\n\nA grunt task is included. Load the tasks with `grunt.loadNpmTasks('css-bundler')` and add some config:\n\n    cssbundler: {\n      options: {\n        prefix: 'foo/bar'\n      },\n      foo: {\n        src: 'src/index.css',\n        dest: 'build/build.css'\n      }\n    }\n\nSee the grunt docs on [Configuring Tasks](http://gruntjs.com/configuring-tasks#files) as it uses the\nstandard Grunt API.\n\n#### Dynamic Bundles\n\nYou can create multiple bundles at once using Grunt's dynamic file mapping:\n\n    cssbundler: {\n      all: {\n        files: [{\n          expand: true,\n          src: ['bundles/**/build.css'],\n          dest: 'build',\n          ext: '.bundled.css'\n        }]\n      }\n    }\n\nThis will create multiple bundles and create a `build` directory in each one with the built bundle. This\nmeans you don't need to manually configure each and every bundle.\n\n### Programmatically\n\n    var Bundler = require('css-bundler');\n    var bundle = new Bundler({\n      // options\n    });\n    bundle.build('path/to/file.css', 'path/to/output', function(){\n      // Callback\n    });\n\n## Example\n\nLet's say you have a CSS file called `index.css`:\n\n    .foo {\n        background: url('path/to/image.png');\n    }\n\nWith the image in the relative directory. You can bundle this into\na new directory and file with all of the assets:\n\n    css-bundler index.css build/build.css\n\nThis will create a `build.css` file in the `build` directory relative\nto the current directory. It will rewrite the paths:\n\n    .foo {\n        background: url('6edf7858c7afecac61ee6bf5df17f196.png');\n    }\n\nAnd it will copy the image to the build directory.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanthonyshort%2Fcss-bundler","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fanthonyshort%2Fcss-bundler","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanthonyshort%2Fcss-bundler/lists"}