A Babel plugin (v1.0.2, stable) that compiles asset imports (e.g., .txt, .svg) at compile time, replacing them with hashed filenames. Eliminates the need for Webpack in universal server-side code, providing a lightweight alternative to file-loader/url-loader. Works with Babel 6+. Last updated in 2017; not actively maintained.
npm install babel-plugin-transform-assetsNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Configures the plugin with file extensions and hashing pattern; shows the transformation of an SVG import.
Consider using babel-plugin-assets or inline assets via Webpack/Metro bundler for modern projects.
Use Babel 6 or fork/update the plugin for Babel 7 compatibility.
Use static import statements only; for dynamic assets, consider Webpack's file-loader.
Ensure 'babel-plugin-transform-assets' is installed and listed in plugins array.
Run: npm install babel-plugin-transform-assets
Add the extension to the 'extensions' array in plugin options.
No dependency data recorded yet.