2024-08-13 04:53:07 +03:00
|
|
|
import * as fs from 'node:fs'
|
2024-06-24 00:20:10 +03:00
|
|
|
|
|
|
|
const packageJson = JSON.parse(fs.readFileSync(new URL('../package.json', import.meta.url)))
|
|
|
|
|
|
|
|
const importMap = {}
|
|
|
|
|
|
|
|
for (const [name, version] of Object.entries(packageJson.dependencies)) {
|
|
|
|
importMap[name] = `npm:${name}@${version}`
|
|
|
|
}
|
|
|
|
|
|
|
|
fs.writeFileSync(new URL('import-map.json', import.meta.url), JSON.stringify({ imports: importMap }, null, 2))
|