Skip to content

Commit 0efbd63

Browse files
Merge pull request #134 from encrypit/build/package
build(package): specify "types", remove "esm/" dir, & add "src/" to files
2 parents 5d00c24 + 4fc58c3 commit 0efbd63

File tree

3 files changed

+7
-14
lines changed

3 files changed

+7
-14
lines changed

.gitignore

-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ jspm_packages
4343
# Build files
4444
cjs/
4545
docs/
46-
esm/
4746

4847
# Vim swap files
4948
*.swp

package.json

+6-12
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,12 @@
33
"version": "1.0.2",
44
"description": "Convert Base64 to Blob/File and Blob/File to Base64.",
55
"author": "Mark <[email protected]>",
6-
"main": "cjs/index.js",
7-
"module": "esm/index.js",
8-
"exports": {
9-
"import": "./esm/index.js",
10-
"require": "./cjs/index.js"
11-
},
6+
"main": "./cjs/index.js",
7+
"types": "./cjs/index.d.ts",
128
"scripts": {
13-
"build": "npm run build:cjs && npm run build:esm",
14-
"build:cjs": "tsc",
15-
"build:esm": "tsc --module nodenext --outDir esm",
9+
"build": "tsc",
1610
"build:watch": "tsc --watch",
17-
"clean": "rm -rf cjs coverage docs esm",
11+
"clean": "rm -rf cjs coverage docs",
1812
"docs": "typedoc",
1913
"lint": "eslint --ignore-path .gitignore --ext .js,.mjs,.ts .",
2014
"lint:fix": "npm run lint -- --fix",
@@ -24,7 +18,7 @@
2418
"prepublishOnly": "pinst --disable && npm run lint && npm run lint:tsc && npm run test:ci && npm run test:esm && npm run clean && npm run build",
2519
"test": "jest",
2620
"test:ci": "CI=true jest --ci --colors --coverage",
27-
"test:esm": "npm run build:esm && node --test src",
21+
"test:esm": "npm run build && node --test src",
2822
"test:watch": "jest --watch"
2923
},
3024
"repository": {
@@ -68,7 +62,7 @@
6862
},
6963
"files": [
7064
"cjs/",
71-
"esm/"
65+
"src/"
7266
],
7367
"engines": {
7468
"node": ">=18"

src/index.test.mjs

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import {
77
base64ToFile,
88
blobToBase64,
99
fileToBase64,
10-
} from '../esm/index.js';
10+
} from '../cjs/index.js';
1111

1212
describe('index', () => {
1313
it('exports base64ToBlob', () => {

0 commit comments

Comments
 (0)