fix: tsconfig refs

This commit is contained in:
alina 🌸 2024-03-01 04:53:01 +03:00
parent fb72d3194d
commit 9420f155b2
Signed by: teidesu
SSH key fingerprint: SHA256:uNeCpw6aTSU4aIObXLvHfLkDa82HWH9EiOj9AXOIRpI
5 changed files with 7 additions and 27 deletions

View file

@ -7,6 +7,7 @@
"./index.ts",
],
"references": [
{ "path": "../core" }
{ "path": "../core" },
{ "path": "../node" }
]
}

View file

@ -8,6 +8,7 @@
"./fake-tls.ts",
],
"references": [
{ "path": "../core" }
{ "path": "../core" },
{ "path": "../node" }
]
}

View file

@ -1,5 +1,3 @@
// ^^ because of this._socket. we know it's not null, almost everywhere, but TS doesn't
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-expect-error
import { normalize } from 'ip6'

View file

@ -7,8 +7,7 @@
"./index.ts"
],
"references": [
{
"path": "../core"
}
{ "path": "../core" },
{ "path": "../node" }
]
}

View file

@ -1,22 +1,3 @@
// /* eslint-disable no-console */
// import * cp from 'child_process'
// import * as fs from 'fs'
// import { join } from 'path'
// const root = new URL('.', import.meta.url).pathname
module.exports = ({ path: { join }, fs, outDir, packageDir, transformFile }) => ({
module.exports = () => ({
esmOnlyDirectives: true,
final() {
const fixWasmPath = (path) => {
transformFile(join(outDir, path), (data) => data.replace('../lib/mtcute.wasm', '../mtcute.wasm'))
}
fixWasmPath('cjs/init.js')
fixWasmPath('cjs/init.web.js')
fixWasmPath('esm/init.js')
fixWasmPath('esm/init.web.js')
fs.cpSync(join(packageDir, 'lib/mtcute.wasm'), join(outDir, 'mtcute.wasm'))
},
})