Skip to content

Commit

Permalink
Export ESM by default, fallback to CJS, build and export types
Browse files Browse the repository at this point in the history
  • Loading branch information
vergilfromadyen authored and georgefromadyen committed Mar 6, 2024
1 parent 3014382 commit 4fb16a0
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 2 deletions.
15 changes: 13 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,13 @@
"scripts": {
"clean": "rm -rf dist",
"dev": "vite",
"build": "vite build",
"build": "vite build && npm run types:build",
"preview": "vite preview",
"lint": "eslint 'src/**/*.{js,ts,tsx}'",
"lint:fix": "npm run lint -- --fix"
"lint:fix": "npm run lint -- --fix",
"types:build": "tsc --project tsconfig-build.json",
"types:check": "tsc && tsc-strict",
"types:watch": "tsc --watch --preserveWatchOutput"
},
"devDependencies": {
"@preact/preset-vite": "^2.8.1",
Expand Down Expand Up @@ -54,6 +57,14 @@
"LICENSE",
"README"
],
"exports": {
"./adyen-document-viewer.min.js": {
"types": "./dist/index.d.ts",
"import": "./dist/adyen-document-viewer.min.js",
"require": "./dist/adyen-document-viewer.min.umd.cjs"
},
"./adyen-document-viewer.min.css": "./dist/adyen-document-viewer.min.css"
},
"optionalDependencies": {
"@rollup/rollup-darwin-x64": "^4.9.1"
}
Expand Down
1 change: 1 addition & 0 deletions src/scss.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
declare module '*.scss';
10 changes: 10 additions & 0 deletions tsconfig-build.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"extends": "./tsconfig.json",
"include": [],
"files": ["src/index.tsx", "node_modules/vite/client.d.ts", "src/scss.d.ts"],
"compilerOptions": {
"rootDir": "src",
"noEmit": false,
"emitDeclarationOnly": true
}
}

0 comments on commit 4fb16a0

Please sign in to comment.