File size: 501 Bytes
bc20498 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
// CJS -> ESM proxy file
// Reference: https://github.com/vitejs/vite/blob/9f268dad2e82c0f1276b1098c0a28f1cf245aa50/packages/vite/index.cjs
module.exports = require('./sync.cjs')
// redirect async functions to ESM
const asyncFunctions = [
'crawlFrameworkPkgs',
'findDepPkgJsonPath',
'findClosestPkgJsonPath',
'pkgNeedsOptimization'
]
for (const fn of asyncFunctions) {
module.exports[fn] = function () {
return import('./index.js').then((mod) => mod[fn].apply(this, arguments))
}
}
|