Transforms importing of asset files at compile time using Babel
npm install babel-plugin-transform-assetsTransforms 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.



``js`
import file from '../file.txt';
will be transformed to
`js`
var file = 'file.txt?9LDjftP';
See the spec for more examples.
`sh`
$ npm install babel-plugin-transform-assets
.babelrc
`json`
{
"plugins": [["transform-assets", {
"extensions": ["svg"],
"name": "[name].[ext]?[sha512:hash:base64:7]",
}]]
}
`javascript``
require('babel-core').transform('code', {
plugins: [['transform-assets', {
extensions: ['svg'],
name: '[name].[ext]?[sha512:hash:base64:7]',
}]]
});
Contributions are very welcome—bug fixes, features, documentation, tests. Just make sure the tests are passing.