Closed DrJume closed 2 years ago
The ESM build is not able to run readFile() correcly, because require('fs') is used. require() is not avaiable in ESM.
readFile()
require('fs')
require()
https://github.com/GoogleChromeLabs/critters/blob/5e32531caf7540842ff9af99e9449975bf0ad399/packages/critters/src/index.js#L149
The only thing missing, is to add
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
to index.js.
index.js
The ESM build is not able to run
readFile()
correcly, becauserequire('fs')
is used.require()
is not avaiable in ESM.https://github.com/GoogleChromeLabs/critters/blob/5e32531caf7540842ff9af99e9449975bf0ad399/packages/critters/src/index.js#L149
The only thing missing, is to add
to
index.js
.