Merge pull request #142 from reuters-graphics/packaging

try types in exports
This commit is contained in:
Jon McClure 2024-01-09 11:43:47 +00:00 committed by GitHub
commit f944fa9ebb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 2 deletions

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',

View file

@ -355,7 +355,11 @@
"./scss/tokens/variables/block": "./dist/scss/tokens/variables/_block.scss",
"./scss/tokens/variables/main": "./dist/scss/tokens/variables/_main.scss",
"./scss/tokens/variables/theme": "./dist/scss/tokens/variables/_theme.scss",
".": "./dist/index.js"
".": {
"types": "./dist/@types/index.d.ts",
"svelte": "./dist/index.js",
"default": "./dist/index.js"
}
},
"svelte": "./dist/index.js",
"bugs": {