try types in exports

This commit is contained in:
Jon McClure 2024-01-09 11:42:30 +00:00
parent f01a6cc9aa
commit d586439b8c

View file

@ -76,7 +76,11 @@ const build = async () => {
if (file === 'index.js') continue; // Always add root index last to exports...
pkgExports[`./${prettifyImport(file)}`] = `./dist/${file}`;
}
pkgExports['.'] = './dist/index.js';
pkgExports['.'] = {
types: './dist/@types/index.d.ts',
svelte: './dist/index.js',
default: './dist/index.js',
};
const pkg = fs.readJSONSync(PACKAGE);
pkg.type = 'module';
pkg.types = './dist/@types/index.d.ts',