I've npm installed smooth-scroll, a package which does not support the import syntax.
I am sure it will work If I manually copy the source code to the libs library and use a script tag:
<script src="/libs/smooth-scroll.js"></script> But how do I use the import syntax with it. I've tried two options and neither worked.
option A:
import scroller from 'smooth-scroll'; option B:
import {scroller} from 'smooth-scroll'; It was a guess and obviously not meant to work but how does one uses import and get Webpack to serve it?
UPDATE:
I've noticed that the package's source starts with the following line:
(function (root, factory) { if ( typeof define === 'function' && define.amd ) { define([], factory(root)); } else if ( typeof exports === 'object' ) { module.exports = factory(root); } else { root.smoothScroll = factory(root); } })(typeof global !== 'undefined' ? global : this.window || this.global, (function (root) { ... Does this means the package already supports ES2015 import?