Skip to content

Commit

Permalink
Use dynamic import instead of require
Browse files Browse the repository at this point in the history
This allows to write konnectors as ES module (while still keeping backward compatibility).

Partially fixes konnectors#635
  • Loading branch information
kamaradclimber authored Apr 23, 2022
1 parent 20268a4 commit 7c19e7b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/cozy-jobs-cli/src/konnector-standalone.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ initReplay()
process.env.SENTRY_DSN = 'false'

if (fs.existsSync(path.resolve(filename))) {
require(require('path').resolve(filename))
import(require('path').resolve(filename))
} else {
console.log(
`ERROR: File ${path.resolve(
Expand Down

0 comments on commit 7c19e7b

Please sign in to comment.