lasso-js / lasso-image

Get optimized image info (URL, width and height) on both the server and the client
2 stars 1 forks source link

lasso-image plugin fails for SVG #2

Closed philidem closed 8 years ago

philidem commented 8 years ago

This code will currently fail in the browser code:

require('src/assets/logo-icon-lightblue.svg')

ERROR:

Error handling request. Error: Dependency of type "svg" is not supported. (dependency={ type: 'svg',
  path: '/Users/philidem/Development/inin/status-reports-web/src/assets/logo-icon-lightblue.svg' }, package="/Users/philidem/Development/inin/status-reports-web/src/pages/index/browser.json"). Registered types:
css, js, comment, loader-metadata, package, intersection, commonjs-def, commonjs-run, commonjs-dep, commonjs-main, commonjs-remap, commonjs-resolved, commonjs-ready, commonjs-search-path, require, marko, less, less-import, png, jpeg, jpg, gif, webp, i18n, i18n-config, i18n-config-def, i18n-locale

We should register svg extension with the lasso-image plugin but we should skip trying to calculate the width and height since it is a vector format.