1.0.7 • Published 1 year ago

svg-loader-js v1.0.7

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

This is a simple loader for including SVG vector images in your JS code.

Install from NPM

npm install -D svg-loader-js

Settings

In webpack config specify

    module: {
        rules: [
            {
                test: /\.(svg)$/i,
                use: "svg-loader-js"
            },
        ],
    },

When using TypeScript add a module definition to your index.d.ts file

declare module "*.svg"

Usage in code

Import svg in your module:

import icon from './icon.svg';

and use a ready to place svg element:

const button = document.createElement("button");
button.append(icon);

Options

Loader has no additional options.

Description

This loader does not support loading an svg file with several icons separated by id

1.1.0

1 year ago

1.0.7

1 year ago

1.0.6

1 year ago

1.0.5

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago