Skip to content

Commit 369b1c3

Browse files
committed
refactor: update build stuff
1 parent 0c07746 commit 369b1c3

File tree

3 files changed

+17
-21
lines changed

3 files changed

+17
-21
lines changed

Diff for: package.json

+7-6
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,25 @@
11
{
22
"name": "@helptheweb/helper",
3-
"version": "1.3.0",
4-
"description": "Accessibility helper for websites by helptheweb.org",
3+
"version": "1.3.1",
54
"type": "module",
65
"main": "./dist/index.cjs.js",
76
"module": "./dist/index.esm.js",
87
"types": "./dist/index.d.ts",
9-
"browser": "./dist/index.min.js",
8+
"unpkg": "./dist/index.min.js",
9+
"jsdelivr": "./dist/index.min.js",
1010
"exports": {
1111
".": {
1212
"types": "./dist/index.d.ts",
13-
"browser": "./dist/index.min.js",
1413
"import": "./dist/index.esm.js",
1514
"require": "./dist/index.cjs.js",
16-
"default": "./dist/index.js"
15+
"default": "./dist/index.esm.js"
1716
}
1817
},
1918
"files": [
20-
"dist"
19+
"dist",
20+
"README.md"
2121
],
22+
"sideEffects": false,
2223
"scripts": {
2324
"build": "tsup",
2425
"watch": "tsup --watch",

Diff for: src/index.ts

+1-7
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
interface HelperOptions {
1+
export interface HelperOptions {
22
defaultFontSize?: number;
33
buttonColor?: string;
44
}
@@ -285,9 +285,3 @@ export class Helper {
285285
document.body.appendChild(container);
286286
}
287287
}
288-
289-
if (typeof window !== 'undefined') {
290-
(window as any).Helper = { Helper };
291-
}
292-
293-
export default Helper;

Diff for: tsup.config.js

+9-8
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,19 @@
1-
import { defineConfig } from 'tsup'
1+
import { defineConfig } from 'tsup';
22

33
export default defineConfig({
44
entry: ['src/index.ts'],
55
format: ['cjs', 'esm', 'iife'],
66
dts: true,
7-
minify: true,
87
clean: true,
8+
minify: true,
9+
sourcemap: true,
10+
splitting: false,
911
globalName: 'AccessibilityHelper',
10-
platform: 'browser',
11-
target: 'es2015',
12-
outDir: 'dist',
1312
outExtension({ format }) {
1413
return {
15-
js: format === 'iife' ? `.min.js` : `.${format}.js`
14+
js: `.${format}.js`
1615
}
17-
}
18-
})
16+
},
17+
platform: 'browser',
18+
target: ['es2015']
19+
});

0 commit comments

Comments
 (0)