{"id":18941354,"url":"https://github.com/jmurzy/babel-plugin-transform-assets","last_synced_at":"2025-04-15T20:31:55.099Z","repository":{"id":140040610,"uuid":"52861297","full_name":"jmurzy/babel-plugin-transform-assets","owner":"jmurzy","description":"Transforms asset imports at compile time using Babel 📦","archived":false,"fork":false,"pushed_at":"2018-11-16T05:41:36.000Z","size":14,"stargazers_count":31,"open_issues_count":3,"forks_count":7,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-08T18:40:30.649Z","etag":null,"topics":["babel","react-native"],"latest_commit_sha":null,"homepage":"","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/jmurzy.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","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":"2016-03-01T08:38:05.000Z","updated_at":"2023-04-11T14:50:44.000Z","dependencies_parsed_at":null,"dependency_job_id":"b73789fe-7660-4587-96c8-40383b0f684d","html_url":"https://github.com/jmurzy/babel-plugin-transform-assets","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jmurzy%2Fbabel-plugin-transform-assets","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jmurzy%2Fbabel-plugin-transform-assets/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jmurzy%2Fbabel-plugin-transform-assets/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jmurzy%2Fbabel-plugin-transform-assets/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jmurzy","download_url":"https://codeload.github.com/jmurzy/babel-plugin-transform-assets/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249148003,"owners_count":21220459,"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":["babel","react-native"],"created_at":"2024-11-08T12:27:41.176Z","updated_at":"2025-04-15T20:31:54.793Z","avatar_url":"https://github.com/jmurzy.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# babel-plugin-transform-assets\n\nTransforms importing of asset files at compile time using Babel. This plugin removes the need to run your server code through [Webpack](https://github.com/webpack/webpack) module bundler when using loaders such as file-loader, url-loader and building \u003cs\u003eisomorphic\u003c/s\u003e universal apps. Aids in creating a cleaner, maintainable build process at the cost of yet another [Babel](https://github.com/babel/babel) [plugin](https://babeljs.io/docs/plugins/).\n\n[![CircleCI](https://img.shields.io/circleci/project/jmurzy/babel-plugin-transform-assets.svg)](https://circleci.com/gh/jmurzy/babel-plugin-transform-assets)\n[![npm version](https://img.shields.io/npm/v/babel-plugin-transform-assets.svg?style=flat-square)](https://www.npmjs.com/package/babel-plugin-transform-assets)\n[![npm](https://img.shields.io/npm/l/babel-plugin-transform-assets.svg)](https://github.com/jmurzy/babel-plugin-transform-assets/blob/master/LICENSE.md)\n\n## Example\n\n```js\nimport file from '../file.txt';\n```\n\nwill be transformed to\n\n```js\nvar file = 'file.txt?9LDjftP';\n```\n\nSee the spec for [more examples](https://github.com/jmurzy/babel-plugin-transform-assets/blob/master/test/index.spec.js).\n\n## Requirements\n[Babel](https://github.com/babel/babel) v6 or higher.\n\n## Installation\n\n```sh\nnpm install -D babel-plugin-transform-assets\n```\n\n## Usage\n\n### Via `.babelrc`\n\n**.babelrc**\n\n```json\n{\n  \"plugins\": [\n      [\"transform-assets\", {\n          \"extensions\": [\"svg\"],\n          \"name\": \"[name].[ext]?[sha512:hash:base64:7]\"\n      }]\n  ]\n}\n```\n\n### Via Node API\n\n```javascript\nrequire('babel-core').transform('code', {\n    plugins: [\n        ['transform-assets', {\n            extensions: ['svg'],\n            name: '[name].[ext]?[sha512:hash:base64:7]',\n        }]\n    ]\n});\n```\n\n### Contributing\n\nContributions are very welcome—bug fixes, features, documentation, tests. Just make sure the tests are passing.\n\n### Related Projects\n\n[babel-plugin-css-modules-transform](https://github.com/michalkvasnicak/babel-plugin-css-modules-transform)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjmurzy%2Fbabel-plugin-transform-assets","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjmurzy%2Fbabel-plugin-transform-assets","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjmurzy%2Fbabel-plugin-transform-assets/lists"}