fix: tsconfig refs
This commit is contained in:
parent
fb72d3194d
commit
9420f155b2
5 changed files with 7 additions and 27 deletions
|
@ -7,6 +7,7 @@
|
|||
"./index.ts",
|
||||
],
|
||||
"references": [
|
||||
{ "path": "../core" }
|
||||
{ "path": "../core" },
|
||||
{ "path": "../node" }
|
||||
]
|
||||
}
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
"./fake-tls.ts",
|
||||
],
|
||||
"references": [
|
||||
{ "path": "../core" }
|
||||
{ "path": "../core" },
|
||||
{ "path": "../node" }
|
||||
]
|
||||
}
|
||||
|
|
|
@ -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'
|
||||
|
|
|
@ -7,8 +7,7 @@
|
|||
"./index.ts"
|
||||
],
|
||||
"references": [
|
||||
{
|
||||
"path": "../core"
|
||||
}
|
||||
{ "path": "../core" },
|
||||
{ "path": "../node" }
|
||||
]
|
||||
}
|
||||
|
|
|
@ -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'))
|
||||
},
|
||||
})
|
||||
|
|
Loading…
Reference in a new issue