Platform agnostic #19
5 changed files with 7 additions and 27 deletions
|
@ -7,6 +7,7 @@
|
||||||
"./index.ts",
|
"./index.ts",
|
||||||
],
|
],
|
||||||
"references": [
|
"references": [
|
||||||
{ "path": "../core" }
|
{ "path": "../core" },
|
||||||
|
{ "path": "../node" }
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,6 +8,7 @@
|
||||||
"./fake-tls.ts",
|
"./fake-tls.ts",
|
||||||
],
|
],
|
||||||
"references": [
|
"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
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
||||||
// @ts-expect-error
|
// @ts-expect-error
|
||||||
import { normalize } from 'ip6'
|
import { normalize } from 'ip6'
|
||||||
|
|
|
@ -7,8 +7,7 @@
|
||||||
"./index.ts"
|
"./index.ts"
|
||||||
],
|
],
|
||||||
"references": [
|
"references": [
|
||||||
{
|
{ "path": "../core" },
|
||||||
"path": "../core"
|
{ "path": "../node" }
|
||||||
}
|
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,22 +1,3 @@
|
||||||
// /* eslint-disable no-console */
|
module.exports = () => ({
|
||||||
// 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 }) => ({
|
|
||||||
esmOnlyDirectives: true,
|
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