Platform agnostic #19

Merged
teidesu merged 25 commits from platform-agnostic into master 2024-03-07 05:54:20 +03:00
6 changed files with 5 additions and 5 deletions
Showing only changes of commit 399336fa4a - Show all commits

View file

@ -1,6 +1,6 @@
module.exports = ({ path: { join }, fs, outDir, packageDir }) => ({
esmOnlyDirectives: true,
final() {
fs.cpSync(join(packageDir, 'lib/mtcute.wasm'), join(outDir, 'mtcute.wasm'))
fs.cpSync(join(packageDir, 'mtcute.wasm'), join(outDir, 'mtcute.wasm'))
},
})

View file

@ -12,4 +12,4 @@ COPY wasm.h Makefile /src/
RUN make
FROM scratch AS binaries
COPY --from=build /src/mtcute.wasm /
COPY --from=build /src/mtcute.wasm ../

View file

@ -43,7 +43,7 @@ ifneq ($(OS),Windows_NT)
endif
endif
OUT := mtcute.wasm
OUT := ../mtcute.wasm
$(OUT): $(SOURCES)
$(CC) $(CFLAGS) -I . -I utils -o $@ $^

View file

@ -14,7 +14,7 @@
},
"exports": {
".": "./src/index.ts",
"./mtcute.wasm": "./lib/mtcute.wasm"
"./mtcute.wasm": "./mtcute.wasm"
},
"distOnlyFields": {
"exports": {

View file

@ -1,7 +1,7 @@
import { initSync } from '../src/index.js'
export async function initWasm() {
const url = new URL('../lib/mtcute.wasm', import.meta.url)
const url = new URL('../mtcute.wasm', import.meta.url)
if (import.meta.env.TEST_ENV === 'node' || import.meta.env.TEST_ENV === 'bun') {
const fs = await import('fs/promises')