Skip to content

Commit

Permalink
chore: update bundling step to reduce package size and bump package v…
Browse files Browse the repository at this point in the history
…ersion
  • Loading branch information
lilpolymath committed Jun 14, 2024
1 parent f577877 commit 721895b
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 24 deletions.
16 changes: 8 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
{
"name": "@bolajiolajide/now-playing",
"version": "0.0.12",
"version": "0.0.13",
"description": "",
"main": "dist/now-playing.cjs.js",
"module": "dist/now-playing.esm.js",
"main": "dist/now-playing.mjs",
"module": "dist/now-playing.mjs",
"types": "dist/now-playing.d.ts",
"type": "module",
"scripts": {
"ex:spotify": "ts-node examples/spotify.ts",
"build": "npx rimraf dist && rollup --config"
},
"exports": {
"require": "./dist/now-playing.cjs.js",
"types": "./dist/now-playing.d.ts",
"default": "./dist/now-playing.esm.js"
"default": "./dist/now-playing.mjs"
},
"files": [
"dist"
"dist/now-playing.mjs",
"dist/now-playing.d.ts"
],
"keywords": [],
"author": "",
"license": "ISC",
"dependencies": {
"@types/node-fetch": "^2.6.11",
"node-fetch": "^3.3.2",
"@types/node-fetch": "2.6.11",
"node-fetch": "2.6.1",
"zod": "3.23.8"
},
"devDependencies": {
Expand Down
31 changes: 15 additions & 16 deletions rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,29 +4,28 @@ import dts from "rollup-plugin-dts";
const config = [
{
input: "./src/index.ts",
output: {
file: "dist/now-playing.cjs.js",
format: "cjs",
sourcemap: true,
},
external: ["zod", "node-fetch"],
plugins: [typescript()],
},
{
input: "./src/index.ts",
output: {
file: "dist/now-playing.esm.js",
format: "es",
sourcemap: true,
},
output: [
{
file: "dist/now-playing.mjs",
format: "esm",
sourcemap: true,
name: "NowPlaying",
},
{
file: "./dist/now-playing.js",
format: "umd",
sourcemap: true,
name: "NowPlaying",
},
],
external: ["zod", "node-fetch"],
plugins: [typescript()],
},
{
input: "./src/index.ts",
output: {
file: "dist/now-playing.d.ts",
format: "es",
format: "esm",
},
plugins: [dts()],
},
Expand Down

0 comments on commit 721895b

Please sign in to comment.