Last active
July 31, 2017 14:25
-
-
Save stephan-v/dd1106bd600041e573b9485e825b63b0 to your computer and use it in GitHub Desktop.
Code splitting SVG images with Webpack.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import(/* webpackChunkName: "js/svg/[request]" */ `resources/assets/images/svg/${this.name}.svg`) | |
.then((module) => { | |
this.svg = module; | |
} | |
).catch(error => 'An error occured while loading the svg'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment