Build ESM import maps with hash versioning
Creates a version hashed import map of all ESM modules in source folder. ESM import map
Minimal config:
``json`
{
"sourcedir": "./src",
"entryhtml": "./src/index.html",
"modifyEntryHtml": true
}
All config options:
`json`
{
"sourcedir": "./src",
"outputFile": "./src/importmap.json",
"entryhtml": "./src/index.html",
"modifyEntryHtml": true,
"generateOutputFile": true,
"excludes": [
"/ignoredfolder/*"
],
"addImports": {
"added": "./lib/other.js"
},
"hashAddedImports": false,
"addScopes": {
"http://test": {
"added": "http://test/some-path/version1/added.js"
}
}
}
If "excludes" is included, i should contain an array of glob patterns to exclude files/folders.
> esm-build
`$3
-c [path to config file] (supply path to config file)
-w (watch for changes and build on demand)With argument(s):
`
> esm-build -c buildconfig.json> esm-build -w
``