Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using svg-pan-zoom from es6 with webpack

How can I use svg-pan-zoom from es6 with webpack? I tried something like this:

import {svgPanZoom} from '../node_modules/svg-pan-zoom/src/svg-pan-zoom.js;

But svgPanZoom is undefined. I also tried simply:

import * as svg_pan_zoom from 'svg-pan-zoom';

But then svg-pan-zoom was set to {};

like image 996
matthewatabet Avatar asked Oct 29 '22 16:10

matthewatabet


1 Answers

The solution was:

import svgPanZoom from "svg-pan-zoom/src/svg-pan-zoom.js";
like image 133
matthewatabet Avatar answered Nov 30 '22 08:11

matthewatabet