Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
> require.extensions['.svg'] = () => 1;
[Function]
> var bla = require('../icons/icon-close.svg')
undefined
> bla
{}
@Fabs
Copy link

Fabs commented Jun 9, 2016

require.extensions['.svg'] = function(module, filename){ 
   module.exports = {default: 1}; 
   return true; 
} 

var x = require('./git.svg').default; 

console.log(x)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment