Skip to content

Commit

Permalink
add index.ts / index.js export for use as library
Browse files Browse the repository at this point in the history
  • Loading branch information
ikreymer committed Sep 3, 2024
1 parent 74d0010 commit 7d2e1ee
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 2 deletions.
17 changes: 17 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
export { getCustomRewriter, rewriteDASH, rewriteHLS } from "./rewrite";

export { SWReplay, SWCollections } from "./swmain";

export { ArchiveDB } from "./archivedb";

export { LiveProxy } from "./liveproxy";

export { getTSMillis, getStatusText, digestMessage, tsToDate, randomId } from "./utils";

export { createLoader } from "./blockloaders";

export { ZipRangeReader } from "./wacz/ziprangereader";

export { WorkerLoader } from "./loaders";

export { API } from "./api";
2 changes: 2 additions & 0 deletions src/rewrite/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ import { ArchiveResponse } from "../response";
// keep for backwards compatibility with RWP and AWP
export { ArchiveResponse } from "../response";

export { rewriteDASH, rewriteHLS } from "./rewriteVideo";

// ===========================================================================
const STYLE_REGEX = /(url\s*\(\s*[\\"']*)([^)'"]+)([\\"']*\s*\))/gi;

Expand Down
3 changes: 1 addition & 2 deletions test/helpers/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ export async function doRewrite({
useBaseRules = true,
isLive = false,
isAjax = false,
extraOpts = null,
returnHeaders = false,
extraOpts = {},
headInsertFunc = null,
encoding = "utf8",
headersDict = {},
Expand Down
1 change: 1 addition & 0 deletions webpack.config.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ module.exports = {
//"wombat": "@webrecorder/wombat/src/wbWombat.js",
//"wombatWorkers": "@webrecorder/wombat/src/wombatWorkers.js",
sw: "./src/sw.ts",
index: "./src/index.ts"
},
output: {
path: path.join(__dirname, "dist"),
Expand Down

0 comments on commit 7d2e1ee

Please sign in to comment.