Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

advanced-url-loader

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

advanced-url-loader

> Based on [url-loader](https://github.com/webpack/url-loader)

  • 0.0.4
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
5
Maintainers
1
Weekly downloads
 
Created
Source

Advanced url loader for Webpack

Based on url-loader

Works exactly like url-loader but allows to specify how encode specific MIME-type. For example for SVG there is no necessary to encode source in base64, because it works with raw content encoded with encodeURIComponent as well. It will decrease ~30% of content length and save browser resources for unpacking base64 string.

Configuration

For compatibility with url-loader advancedUrl option is used:

{
  module: {
    loaders: [
      {
        test: /\.(jpg|png|gif|svg)$/,
        loader: 'advanced-url?limit=10000'
      }
    ]
  },
  advancedUrl: {
    handlers: {
      'image/svg+xml': function (content) {
        return 'data:image/svg+xml,' + encodeURIComponent(content);
      }
    }
  }
}

FAQs

Package last updated on 03 Feb 2016

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