- breaking: change params signature
mappingsForNodeResolution
,mappingsForDevDependencies
andpackageUserConditions
moves tonodeMappings
entryPoints
,runtime
,magicExtensions
moves toimportResolution
- node mappings enabled by default
- removeUnusedMappings enabled by default
6.0.0
import { writeImportmaps } from "@jsenv/importmap-node-module";
await writeImportmaps({
projectDirectoryUrl: new URL("./", import.meta.url),
importmaps: {
"demo.importmap": {
mappingsForNodeResolution: true,
mappingsForDevDependencies: true,
runtime: "browser",
packageUserConditions: ["browser"],
entryPoints: ["index.html"],
magicExtensions: [".js", "inherit"],
removeUnusedMappings: true,
},
},
});
7.0.0
import { writeImportmaps } from "@jsenv/importmap-node-module";
await writeImportmaps({
projectDirectoryUrl: new URL("./", import.meta.url),
importmaps: {
"demo.importmap": {
nodeMappings: {
devDependencies: true,
packageUserConditions: ["browser"],
},
importResolution: {
runtime: "browser",
entryPoints: ["index.html"],
magicExtensions: [".js", "inherit"],
},
},
},
});
- major:
writeImportMapFiles
function renamedwriteImportmaps
- major:
importMapFiles
param renamedimportmaps
- major:
entryPointsToCheck
param renamedentryPoints
- major:
manualImportMap
option renamedmanualImportmap
- feat: Allow to write importmap into html files
- feat: warning when
bareSpecifierAutomapping
is used withoutentryPoints
- feat: allow to use options related to entry points without having to specify entry point when importmap is written to html. Both in CLI and API.
- feat: add --dir to CLI
- Add CLI
- Allow root package without names
- add
babelConfigFileUrl
param towriteImportMapFiles
- Enable many parser plugins by default such as import assertions
- Update dependencies