Skip to content

Commit

Permalink
Bundle TypeScript directly to use in sourcemaps
Browse files Browse the repository at this point in the history
  • Loading branch information
Acconut committed Jan 16, 2025
1 parent f40ca51 commit e18117c
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 5 deletions.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@
"@biomejs/biome": "^1.7.3",
"@rollup/plugin-commonjs": "^28.0.2",
"@rollup/plugin-node-resolve": "^16.0.0",
"@rollup/plugin-typescript": "^12.1.2",
"chokidar-cli": "^3.0.0",
"into-stream": "^6.0.0",
"jasmine": "^5.1.0",
Expand Down Expand Up @@ -94,7 +95,7 @@
"scripts": {
"clean": "rm -rf dist lib.cjs lib.esm",
"build-test-bundle": "mkdir -p dist && rollup test/spec/browser-index.js --format iife --sourcemap --plugin node-resolve --plugin commonjs --file dist/browser-test-bundle.js",
"build-bundle": "mkdir -p dist && rollup lib.esm/browser/index.js --format umd --name tus --plugin node-resolve --plugin commonjs --file ./dist/tus.js --sourcemap --sourcemapFile ./dist/tus.js.map",
"build-bundle": "mkdir -p dist && rollup lib/browser/index.ts --format umd --name tus --plugin typescript --plugin node-resolve --plugin commonjs --file ./dist/tus.js --sourcemap --sourcemapFile ./dist/tus.js.map",
"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.cjs/package.json",
Expand Down
3 changes: 2 additions & 1 deletion tsconfig-cjs.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"compilerOptions": {
"module": "commonjs",
"moduleResolution": null,
"outDir": "lib.cjs/"
"outDir": "lib.cjs/",
"declaration": true
}
}
3 changes: 2 additions & 1 deletion tsconfig-esm.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"outDir": "lib.esm/"
"outDir": "lib.esm/",
"declaration": true
}
}
1 change: 0 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
"strict": true,
"skipLibCheck": true,
"allowJs": false,
"declaration": true,
// TODO: Remove this over time
"noImplicitAny": false
}
Expand Down
10 changes: 9 additions & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,15 @@
is-module "^1.0.0"
resolve "^1.22.1"

"@rollup/pluginutils@^5.0.1":
"@rollup/plugin-typescript@^12.1.2":
version "12.1.2"
resolved "https://registry.yarnpkg.com/@rollup/plugin-typescript/-/plugin-typescript-12.1.2.tgz#ebaeec2e7376faa889030ccd7cb485a649e63118"
integrity sha512-cdtSp154H5sv637uMr1a8OTWB0L1SWDSm1rDGiyfcGcvQ6cuTs4MDk2BVEBGysUWago4OJN4EQZqOTl/QY3Jgg==
dependencies:
"@rollup/pluginutils" "^5.1.0"
resolve "^1.22.1"

"@rollup/pluginutils@^5.0.1", "@rollup/pluginutils@^5.1.0":
version "5.1.4"
resolved "https://registry.yarnpkg.com/@rollup/pluginutils/-/pluginutils-5.1.4.tgz#bb94f1f9eaaac944da237767cdfee6c5b2262d4a"
integrity sha512-USm05zrsFxYLPdWWq+K3STlWiT/3ELn3RcV5hJMghpeAIhxfsUIg6mt12CBJBInWMV4VneoV7SfGv8xIwo2qNQ==
Expand Down

0 comments on commit e18117c

Please sign in to comment.