Skip to content

Commit

Permalink
Rename lib.es5 to more appropriate lib.cjs
Browse files Browse the repository at this point in the history
  • Loading branch information
Acconut committed May 28, 2024
1 parent 57cbb49 commit 8538ead
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.vscode/settings.json
node_modules
demos/reactnative/.expo
lib.es5
lib.cjs
lib.esm
dist
.DS_Store
Expand Down
12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
"name": "tus-js-client",
"version": "4.1.0",
"description": "A pure JavaScript client for the tus resumable upload protocol",
"main": "lib.es5/node/index.js",
"main": "lib.cjs/node/index.js",
"module": "lib.esm/node/index.js",
"files": ["lib.es5/**/*", "lib.esm/**/*", "dist/**/*"],
"files": ["lib.cjs/**/*", "lib.esm/**/*", "dist/**/*"],
"browser": {
"./lib.es5/node/index.js": "./lib.es5/browser/index.js",
"./lib.cjs/node/index.js": "./lib.cjs/browser/index.js",
"./lib.esm/node/index.js": "./lib.esm/browser/index.js"
},
"types": "./lib.es5/browser/index.d.ts",
"types": "./lib.cjs/browser/index.d.ts",
"engines": {
"node": ">=18"
},
Expand Down Expand Up @@ -55,10 +55,10 @@
},
"scripts": {
"build-test-bundle": "mkdir -p dist && browserify test/spec/browser-index.cjs -d -o dist/browser-test-bundle.js",
"build-bundle": "mkdir -p dist && browserify lib.es5/browser/index.js -s tus -d | exorcist ./dist/tus.js.map > dist/tus.js",
"build-bundle": "mkdir -p dist && browserify lib.cjs/browser/index.js -s tus -d | exorcist ./dist/tus.js.map > dist/tus.js",
"build-minify": "uglifyjs ./dist/tus.js -o ./dist/tus.min.js --compress --mangle --source-map \"content='./dist/tus.js.map',url='tus.min.js.map'\"",
"build-transpile-esm": "tsc --project tsconfig-esm.json && echo '{\"type\":\"module\"}' > lib.esm/package.json",
"build-transpile-cjs": "tsc --project tsconfig-cjs.json && echo '{\"type\":\"commonjs\"}' > lib.es5/package.json",
"build-transpile-cjs": "tsc --project tsconfig-cjs.json && echo '{\"type\":\"commonjs\"}' > lib.cjs/package.json",
"build-transpile": "npm-run-all build-transpile-esm build-transpile-cjs",
"build": "npm-run-all build-transpile build-bundle build-minify build-test-bundle",
"watch-bundle": "chokidar --initial \"lib/**/*\" -c \"npm run build-bundle\"",
Expand Down
3 changes: 1 addition & 2 deletions tsconfig-cjs.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
"compilerOptions": {
"module": "commonjs",
"moduleResolution": null,
// TODO: Rename to lib.cjs
"outDir": "lib.es5/"
"outDir": "lib.cjs/"
}
}

0 comments on commit 8538ead

Please sign in to comment.