I use the following (ES5) code to currently import a module and call it as a function (where ...
represents some arguments):
var rimraf = require("rimraf")
rimraf(...)
I would like to utilise ES6's import
with my code so I have tried the following ways:
import * as rimraf from "rimraf"
import rimraf from "rimraf"
These are the ways to import
that I have read about in various places, however each time I attempt to call rimraf(...)
I get the error ReferenceError: rimraf is not defined
.
Apologies if I'm just being stupid, but what is the correct way to implement my import
?