1.0.7 • Published 2 years ago

svg-loader-js v1.0.7

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years 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

2 years ago

1.0.7

2 years ago

1.0.6

2 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago