Socket
Socket
Sign inDemoInstall

babel-plugin-transform-assets

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

babel-plugin-transform-assets

Transforms importing of asset files at compile time using Babel


Version published
Weekly downloads
1.6K
decreased by-10.58%
Maintainers
1
Weekly downloads
 
Created
Source

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.

CircleCI npm version npm

Example

import file from '../file.txt';

will be transformed to

var file = 'file.txt?9LDjftP';

See the spec for more examples.

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]',
            }]]
});

Contributing

Contributions are very welcome—bug fixes, features, documentation, tests. Just make sure the tests are passing.

babel-plugin-css-modules-transform

Keywords

FAQs

Package last updated on 15 Jul 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc