我有这个要求声明
require('smoothscroll-polyfill').polyfill();
Run Code Online (Sandbox Code Playgroud)
但我想把它写成es6 import语句
我试过了
import 'smoothscroll-polyfill';
Run Code Online (Sandbox Code Playgroud)
和
import * as 'smoothscrollPolyfill' from 'smoothscroll-polyfill';
Run Code Online (Sandbox Code Playgroud)
但是无法让它正常工作,那么导入这样的包的正确方法是什么?