Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gabrielhpugliese/d9d5fa251d397f5d9e5ee3513e9947fa to your computer and use it in GitHub Desktop.
Save gabrielhpugliese/d9d5fa251d397f5d9e5ee3513e9947fa to your computer and use it in GitHub Desktop.
> 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