Skip to content

Commit

Permalink
Fix exports and allow helpers import (#2)
Browse files Browse the repository at this point in the history
  • Loading branch information
svemat01 authored Mar 2, 2024
1 parent 93805c4 commit 32d7d97
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 6 deletions.
28 changes: 24 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,36 @@
"name": "use-enstate",
"description": "",
"main": "dist/index.js",
"module": "dist/index.mjs",
"types": "dist/index.d.ts",
"type": "module",
"files": [
"dist",
"src",
"tsconfig.json"
],
"exports": {
".": {
"import": "./dist/index.js",
"require": "./dist/index.cjs",
"types": "./dist/index.d.ts"
},
"./helpers": {
"import": "./dist/helpers.js",
"require": "./dist/helpers.cjs",
"types": "./dist/helpers.d.ts"
}
},
"typesVersions": {
"*": {
".": [
"./dist/index.d.ts"
],
"./helpers": [
"./dist/helpers.d.ts"
]
}
},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"build": "tsup ./src/index.ts",
"build": "tsup",
"lint": "eslint -c .eslintrc.json --ext .ts ./src",
"pub": "yarn build && yarn publish --access public"
},
Expand Down
9 changes: 7 additions & 2 deletions tsup.config.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
import { defineConfig } from 'tsup';

export default defineConfig({
entryPoints: ['src/index.ts'], // Adjust the entry point based on your project structure
entry: ['src/index.ts', 'src/helpers.ts'], // Adjust the entry point based on your project structure
format: ['cjs', 'esm'], // Generate CommonJS and ECMAScript Modules bundles
dts: true, // Generate TypeScript declaration files (*.d.ts)
outDir: 'dist', // Output directory for the generated bundles
minify: true, // Optionally, enable minification
sourcemap: true, // Generate sourcemaps for easier debugging
splitting: true,
clean: true,
minify: true, // Optionally, enable minification
minifyIdentifiers: true,
minifyWhitespace: true,
minifySyntax: true,
});

0 comments on commit 32d7d97

Please sign in to comment.