Skip to content

Commit 3207a51

Browse files
committed
Fix module resolution errors
Diagnosis: Webpack can't somehow handle UMD modules, so when TypeScript was configured to generate UMD modules, Webpack could no longer bundle them correctly, even if it emitted no errors.
1 parent 5eb69ce commit 3207a51

File tree

3 files changed

+4
-8
lines changed

3 files changed

+4
-8
lines changed

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@
1111
"types"
1212
],
1313
"scripts": {
14-
"build": "npm run build:ts && npm run build:web",
15-
"build:web": "rimraf dist/ && webpack",
16-
"build:ts": "rimraf types/ && tsc --project tsconfig.json",
14+
"build": "rimraf dist && npm run build:ts && npm run build:web",
15+
"build:web": "webpack",
16+
"build:ts": "tsc --project tsconfig.json",
1717
"prettier": "prettier --write \"src/**/*.ts\" \"test/**/*.js\" ",
1818
"lint": "tslint -p tsconfig.json",
1919
"prepare": "npm run build",

src/index.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
(window as any).global = window;
2-
// @ts-ignore
3-
window.Buffer = window.Buffer || require('buffer').Buffer;
4-
51
import { Uploader } from './Uploader';
62
import { Downloader } from './Downloader';
73
import { Access } from './Access';

tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"compilerOptions": {
33
"target": "es5",
4-
"module": "umd",
4+
"module": "commonjs",
55
"outDir": "dist",
66
"declaration": true,
77
"declarationDir": "types",

0 commit comments

Comments
 (0)