@rosmarinus/import-map-generator
v0.2.6
Published
a tool to generate a import map json
Downloads
1
Readme
@rosmarinus/import-map-generator
Generate an import map from your source code, which can be used to load modules in sub path.
Install
npm install @rosmarinus/import-map-generator -D
Usage
CLI
rosmarinus-import-map-generator gen-export-map --config map.config.js
API
import { genExportMap } from '@rosmarinus/import-map-generator';
await genExportMap({
input: ['src/modules/*.ts'];
outputFileName: 'dist/map.json';
cwd: process.cwd();
});
Configuration
// map.config.js
module.exports = {
// glob pattern to find all files that should be included in the export map
input: ['src/modules/*.ts'],
exclude: [],
// output file name
outputFileName: 'dist/map.json',
// current working directory
srcDir: 'src',
};