https://github.com/floor/rollup-plugin-rawsvg
Import SVG raw files
https://github.com/floor/rollup-plugin-rawsvg
Last synced: about 1 month ago
JSON representation
Import SVG raw files
- Host: GitHub
- URL: https://github.com/floor/rollup-plugin-rawsvg
- Owner: floor
- Created: 2019-09-06T12:51:09.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2019-09-06T14:33:44.000Z (almost 7 years ago)
- Last Synced: 2026-03-12T13:48:28.900Z (3 months ago)
- Language: JavaScript
- Size: 3.91 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
Awesome Lists containing this project
README
# rollup-plugin-rawsvg
Import SVG raw files
## Installation
```bash
yarn install rollup-plugin-raw-svg --dev
```
## Usage
```js
// rollup.config.js
import rawsvg from 'rollup-plugin-rawsvg';
export default {
entry: 'src/input.js',
dest: 'dist/output.js',
plugins: [
rawsvg()
]
};
```
You can use svgs in your bundle thusly:
```js
import iconMenu from './icon/menu.svg'
document.body.appendChild( iconMenu )
```
SVGs are not encoded using base64, it will only import raw files as text
## Sources
This plugin was built (based on the rollup-plugin-svg) but remove base64 encoding mecanism
[rollup-plugin-svg](https://github.com/rollup/rollup-plugin-svg)
## License
MIT