diff --git a/package.json b/package.json index b2a209e2..8585bdbd 100644 --- a/package.json +++ b/package.json @@ -19,6 +19,10 @@ ".": { "types": "./dist/src/index.d.ts", "import": "./dist/gosling.js" + }, + "./utils": { + "types": "./dist/src/exported-utils.d.ts", + "import": "./dist/utils.js" } }, "scripts": { diff --git a/src/exported-utils.ts b/src/exported-utils.ts new file mode 100644 index 00000000..996af136 --- /dev/null +++ b/src/exported-utils.ts @@ -0,0 +1,8 @@ +export { + getRelativeGenomicPosition, + computeChromSizes, + getChromInterval, + getChromTotalSize, + parseGenomicPosition +} from './core/utils/assembly'; +export { sanitizeChrName } from './data-fetchers/utils'; diff --git a/vite.config.js b/vite.config.js index aefa6c3f..8693651a 100644 --- a/vite.config.js +++ b/vite.config.js @@ -91,9 +91,11 @@ const esm = defineConfig({ target: 'es2018', sourcemap: true, lib: { - entry: path.resolve(__dirname, 'src/index.ts'), + entry: { + gosling: path.resolve(__dirname, 'src/index.ts'), + utils: path.resolve(__dirname, 'src/exported-utils.ts'), + }, formats: ['es'], - fileName: 'gosling' }, rollupOptions: { external } },