Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Doesn't work in Edge #289

Open
andrecalvo opened this issue Oct 28, 2019 · 2 comments
Open

Doesn't work in Edge #289

andrecalvo opened this issue Oct 28, 2019 · 2 comments

Comments

@andrecalvo
Copy link

When using the loader like so to load an inline SVG...
import AlertIcon from "-!react-svg-loader!images/foo.svg;

Edge errors as it can't understand the rest/spread syntax.

@tf
Copy link

tf commented Dec 16, 2019

Using the rollup variant of this loader, I needed to configure the babel plugin to also compile files with svg extension to make it work:

plugins: [
  babel({
    exclude: 'node_modules/**',
    extensions: ['js', 'jsx', 'svg']
  }),
  resolve(),
  commonjs(),
  reactSvg({
    svgo: {multipass: true}
  })
]

@LucaMele
Copy link

Agree. The build export should be a traditional ESM (ES5 + import/export).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants