diff --git a/package.json b/package.json index 531fa2d9..bb16ec99 100644 --- a/package.json +++ b/package.json @@ -7,10 +7,19 @@ "es2015": "dist/es/index.js", "type": "module", "exports": { - "types": "dist/types/index.d.ts", - "require": "dist/cjs/index.cjs", - "default": "dist/es/index.js" + ".": { + "types": "./dist/types/index.d.ts", + "require": "./dist/cjs/index.cjs", + "default": "./dist/es/index.js" + }, + "./SearchableMap": { + "types": "./dist/types/SearchableMap.d.ts", + "require": "./dist/cjs/SearchableMap.cjs", + "default": "./dist/es/SearchableMap.js" + } }, + "unpkg": "./dist/umd/index.js", + "jsdelivr": "./dist/umd/index.js", "types": "./dist/types/index.d.ts", "author": "Luca Ongaro", "homepage": "https://lucaong.github.io/minisearch/", diff --git a/rollup.config.js b/rollup.config.js index de70754f..1ecb439c 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -47,12 +47,13 @@ export default process.env.BENCHMARKS === 'true' ? [benchmarks] : [ config({ format: 'cjs', input: 'src/index.ts', output: 'cjs', dir: 'cjs', extension: 'cjs', exports: 'default' }), config({ format: 'umd', input: 'src/index.ts', output: 'umd', name: 'MiniSearch' }), - // Type declarations - config({ format: 'es', input: 'src/index.ts', output: 'dts', dir: 'types', extension: 'd.ts' }), - // SearchableMap config({ format: 'es', input: 'src/SearchableMap/SearchableMap.ts', output: 'es6' }), config({ format: 'es', input: 'src/SearchableMap/SearchableMap.ts', output: 'es5m', dir: 'es5m' }), config({ format: 'cjs', input: 'src/SearchableMap/SearchableMap.ts', output: 'cjs', dir: 'cjs', extension: 'cjs', exports: 'default' }), - config({ format: 'umd', input: 'src/SearchableMap/SearchableMap.ts', output: 'umd', name: 'MiniSearch' }) + config({ format: 'umd', input: 'src/SearchableMap/SearchableMap.ts', output: 'umd', name: 'MiniSearch' }), + + // Type declarations + config({ format: 'es', input: 'src/index.ts', output: 'dts', dir: 'types', extension: 'd.ts' }), + config({ format: 'es', input: 'src/SearchableMap/SearchableMap.ts', output: 'dts', dir: 'types', extension: 'd.ts' }) ]