diff options
Diffstat (limited to 'src/lib/gen-webext-polyfill.ts')
-rw-r--r-- | src/lib/gen-webext-polyfill.ts | 15 |
1 files changed, 15 insertions, 0 deletions
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;`) |