1

I'm trying to find an example for es6 form of the following:

require('shipit-deploy')(shipit)

I would usually go for something like

import 'shipit-deploy'

however in this case there is (shipit) at the end of require that I am not entirely sure how to import correctly.

Ilja
  • 44,142
  • 92
  • 275
  • 498

1 Answers1

3

require('shipit-deploy')(shipit) works by first requiring the specified module, and then calling the result with shipit as argument. You can achieve the same result by first importing 'shipit-deploy' into some variable, and then calling the result with shipit as argument.

import shipitDeployImport from 'shipit-deploy'
const shipitDeploy = shipitDeployImport(shipit)
Michał Perłakowski
  • 88,409
  • 26
  • 156
  • 177