diff options
Diffstat (limited to 'src/lib')
-rw-r--r-- | src/lib/.gitignore | 1 | ||||
-rw-r--r-- | src/lib/gen-webext-polyfill.ts | 15 | ||||
l--------- | src/lib/tsconfig.jsonc | 1 |
3 files changed, 17 insertions, 0 deletions
diff --git a/src/lib/.gitignore b/src/lib/.gitignore new file mode 100644 index 0000000..6f7de8f --- /dev/null +++ b/src/lib/.gitignore @@ -0,0 +1 @@ +/webext-polyfill.ts diff --git a/src/lib/gen-webext-polyfill.ts b/src/lib/gen-webext-polyfill.ts new file mode 100644 index 0000000..5c09e07 --- /dev/null +++ b/src/lib/gen-webext-polyfill.ts @@ -0,0 +1,15 @@ +import fs from 'node:fs/promises'; +const files = {} as Record<string, string> +const promises = [] as Promise<void>[] +for (const f of await fs.readdir('node_modules/@types/webextension-polyfill', { + recursive: true, +})) + promises.push((async () => { + const fp = 'node_modules/@types/webextension-polyfill/' + f; + const stat = await fs.stat(fp) + if (!stat.isDirectory()) + files[fp] = await fs.readFile(fp, 'utf-8') + })()) +await Promise.all(promises) +await fs.writeFile('src/lib/webext-polyfill.ts', `export const files = ${JSON.stringify(files, null, 2)}; +export default files;`) diff --git a/src/lib/tsconfig.jsonc b/src/lib/tsconfig.jsonc new file mode 120000 index 0000000..fd0e474 --- /dev/null +++ b/src/lib/tsconfig.jsonc @@ -0,0 +1 @@ +../../tsconfig.json
\ No newline at end of file |