babel-plugin-transform-assets
Transforms importing of asset files at compile time using Babel. This plugin removes the need to run your server code through Webpack module bundler when using loaders such as file-loader, url-loader and building isomorphic universal apps. Aids in creating a cleaner, maintainable build process at the cost of yet another Babel plugin.
Requirements
Babel v6 or higher.
Installation
$ npm install babel-plugin-transform-assets
Usage
Via .babelrc
.babelrc
{
"plugins": [["transform-assets", {
"extensions": ["svg"],
"name": "[name].[ext]?[sha512:hash:base64:7]",
}]]
}
Via Node API
require('babel-core').transform('code', {
plugins: [['transform-assets', {
extensions: ['svg'],
name: '[name].[ext]?[sha512:hash:base64:7]',
}]]
});
Release Notes
- 0.1.0 Minor changes, Update dependencies
- 0.0.1 Initial release