Closed dmail closed 4 years ago
I imagine something like this:
import-map-custom.importmap
{ "imports": { "foo": "./bar.js" } }
Then generate-import-map would be like this:
script/generate-import-map/generate-import-map.js
import { readFileSync } from "fs" import { composeTwoImportMaps } from '@jsenv/import-map' import { generateImportMapForProjectPackage } from "@jsenv/node-module-import-map" const importMapForNodeModules = await generateImportMapForProjectPackage() const importMap = composeTwoImportMaps(importMapForNodeModules, JSON.parse(readFileSync('./import-map-custom.importmap'))) writeFileSync('./import-map.importmap', JSON.stringify(importMap))
To simplify this, let's add a new parameter to generateImportMapForProjectPackage like customImportMapFileRelativeUrl
customImportMapFileRelativeUrl
Done in 12.0.0 that is introducing generateImportMapForProject and importMapInputs
generateImportMapForProject
importMapInputs
I imagine something like this:
import-map-custom.importmap
Then generate-import-map would be like this:
script/generate-import-map/generate-import-map.js
To simplify this, let's add a new parameter to generateImportMapForProjectPackage like
customImportMapFileRelativeUrl