Skip to content

vagusX/webpack-svg-sprite-sample

Repository files navigation

Webpack SVG sprite sample project

###Usage

in Vue

npm run dev:vue
npm run build:vue

in React

npm run dev:react
npm run build:react

Update at 2016-06-05

Tricks:

  • Using svg-sprite-loader to build a svg sprite inject into body
  • Using svgo-loader to pretty svg files (you can see the icon panda, necessary attributes was removed)
  • Using the code below (require.context) to require all svg icons in one folder with webpack
const _require = require.context('../../assets/icons', false, /\.svg$/)
_require.keys().forEach(key => _require(key))

About

a webpack SVG sprite sample when using Vue and React

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published