inline-svg-loader

0.0.1 • Public • Published

html loader for webpack

Just a quick hack for now, will improve on it soon...

It converts <svg src="some.svg"> to an <svg> element with inlined contents of the file. The file is resolved through webpack.

Currently it only works as loader on top of html-loader and the regex is poor too.

You will need to setup loaders something like this:

{
  { test: "\.html$", loader: "inline-svg-loader!html-loader?attrs[]=svg:src" },
  { test: "\.svg$", loader: "raw-loader" }
}

Dependencies (4)

Dev Dependencies (0)

    Package Sidebar

    Install

    npm i inline-svg-loader

    Weekly Downloads

    2,816

    Version

    0.0.1

    License

    none

    Last publish

    Collaborators

    • qingting