Skip to content

Commit 75f215c

Browse files
committedDec 4, 2023
fix(async-queue): properly split CJS, ESM and IIFE
1 parent 1e691b4 commit 75f215c

File tree

2 files changed

+15
-11
lines changed

2 files changed

+15
-11
lines changed
 

‎packages/async-queue/package.json

+11-10
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,21 @@
44
"description": "Sequential asynchronous lock-based queue for promises",
55
"author": "@sapphire",
66
"license": "MIT",
7-
"main": "dist/index.js",
8-
"module": "dist/index.mjs",
9-
"browser": "dist/index.global.js",
10-
"unpkg": "dist/index.global.js",
11-
"types": "dist/index.d.ts",
7+
"main": "dist/cjs/index.cjs",
8+
"module": "dist/esm/index.mjs",
9+
"browser": "dist/iife/index.global.js",
10+
"unpkg": "dist/iife/index.global.js",
11+
"types": "dist/cjs/index.d.ts",
1212
"exports": {
1313
"import": {
14-
"types": "./dist/index.d.mts",
15-
"default": "./dist/index.mjs"
14+
"types": "./dist/esm/index.d.mts",
15+
"default": "./dist/esm/index.mjs"
1616
},
1717
"require": {
18-
"types": "./dist/index.d.ts",
19-
"default": "./dist/index.js"
20-
}
18+
"types": "./dist/cjs/index.d.ts",
19+
"default": "./dist/cjs/index.cjs"
20+
},
21+
"browser": "./dist/iife/index.global.js"
2122
},
2223
"sideEffects": false,
2324
"homepage": "https://github.com/sapphiredev/utilities/tree/main/packages/async-queue",

‎packages/async-queue/tsup.config.ts

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
import type { Options } from 'tsup';
12
import { createTsupConfig } from '../../scripts/tsup.config';
23

3-
export default createTsupConfig({ globalName: 'SapphireAsyncQueue', target: 'es2020' });
4+
const options: Options = { target: 'es2020' };
5+
6+
export default createTsupConfig(options, options, { ...options, globalName: 'SapphireAsyncQueue' });

0 commit comments

Comments
 (0)
Please sign in to comment.