Skip to content

Commit 721895b

Browse files
committed
chore: update bundling step to reduce package size and bump package version
1 parent f577877 commit 721895b

File tree

2 files changed

+23
-24
lines changed

2 files changed

+23
-24
lines changed

package.json

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,29 @@
11
{
22
"name": "@bolajiolajide/now-playing",
3-
"version": "0.0.12",
3+
"version": "0.0.13",
44
"description": "",
5-
"main": "dist/now-playing.cjs.js",
6-
"module": "dist/now-playing.esm.js",
5+
"main": "dist/now-playing.mjs",
6+
"module": "dist/now-playing.mjs",
77
"types": "dist/now-playing.d.ts",
88
"type": "module",
99
"scripts": {
1010
"ex:spotify": "ts-node examples/spotify.ts",
1111
"build": "npx rimraf dist && rollup --config"
1212
},
1313
"exports": {
14-
"require": "./dist/now-playing.cjs.js",
1514
"types": "./dist/now-playing.d.ts",
16-
"default": "./dist/now-playing.esm.js"
15+
"default": "./dist/now-playing.mjs"
1716
},
1817
"files": [
19-
"dist"
18+
"dist/now-playing.mjs",
19+
"dist/now-playing.d.ts"
2020
],
2121
"keywords": [],
2222
"author": "",
2323
"license": "ISC",
2424
"dependencies": {
25-
"@types/node-fetch": "^2.6.11",
26-
"node-fetch": "^3.3.2",
25+
"@types/node-fetch": "2.6.11",
26+
"node-fetch": "2.6.1",
2727
"zod": "3.23.8"
2828
},
2929
"devDependencies": {

rollup.config.js

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -4,29 +4,28 @@ import dts from "rollup-plugin-dts";
44
const config = [
55
{
66
input: "./src/index.ts",
7-
output: {
8-
file: "dist/now-playing.cjs.js",
9-
format: "cjs",
10-
sourcemap: true,
11-
},
12-
external: ["zod", "node-fetch"],
13-
plugins: [typescript()],
14-
},
15-
{
16-
input: "./src/index.ts",
17-
output: {
18-
file: "dist/now-playing.esm.js",
19-
format: "es",
20-
sourcemap: true,
21-
},
7+
output: [
8+
{
9+
file: "dist/now-playing.mjs",
10+
format: "esm",
11+
sourcemap: true,
12+
name: "NowPlaying",
13+
},
14+
{
15+
file: "./dist/now-playing.js",
16+
format: "umd",
17+
sourcemap: true,
18+
name: "NowPlaying",
19+
},
20+
],
2221
external: ["zod", "node-fetch"],
2322
plugins: [typescript()],
2423
},
2524
{
2625
input: "./src/index.ts",
2726
output: {
2827
file: "dist/now-playing.d.ts",
29-
format: "es",
28+
format: "esm",
3029
},
3130
plugins: [dts()],
3231
},

0 commit comments

Comments
 (0)