Skip to content

Commit

Permalink
feat: export as neutral target bundle
Browse files Browse the repository at this point in the history
  • Loading branch information
kettanaito committed Apr 14, 2023
1 parent bf3e168 commit 58e5d02
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 31 deletions.
25 changes: 8 additions & 17 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,15 @@
"name": "@open-draft/logger",
"version": "0.2.2",
"description": "Environment-agnostic, ESM-friendly logger for simple needs.",
"main": "./lib/node/index.js",
"module": "./lib/node/index.mjs",
"browser": "./lib/browser/index.js",
"types": "./lib/node/index.d.ts",
"main": "./lib/index.js",
"module": "./lib/index.mjs",
"types": "./lib/index.d.ts",
"exports": {
".": {
"browser": {
"types": "./lib/browser/index.d.ts",
"import": "./lib/browser/index.mjs",
"require": "./lib/browser/index.js",
"default": "./lib/browser/index.js"
},
"node": {
"types": "./lib/node/index.d.ts",
"import": "./lib/node/index.mjs",
"require": "./lib/node/index.js",
"default": "./lib/node/index.js"
}
"types": "./lib/index.d.ts",
"require": "./lib/index.js",
"import": "./lib/index.mjs",
"default": "./lib/index.js"
},
"./package.json": "./package.json"
},
Expand Down Expand Up @@ -62,4 +53,4 @@
"is-node-process": "^1.2.0",
"outvariant": "^1.4.0"
}
}
}
17 changes: 3 additions & 14 deletions tsup.config.ts
Original file line number Diff line number Diff line change
@@ -1,21 +1,10 @@
import { defineConfig } from 'tsup'

const nodeConfig = defineConfig({
export default defineConfig({
entry: ['src/index.ts'],
platform: 'node',
platform: 'neutral',
format: ['esm', 'cjs'],
outDir: './lib/node',
outDir: './lib',
bundle: true,
dts: true,
})

const browserConfig = defineConfig({
entry: ['src/index.ts'],
platform: 'browser',
format: ['esm', 'cjs'],
outDir: './lib/browser',
bundle: true,
dts: true,
})

export default [nodeConfig, browserConfig]

0 comments on commit 58e5d02

Please sign in to comment.