mtcute/packages/wasm/build.config.js
alina sireneva 46414e4e19
All checks were successful
Build and deploy docs / build (push) Successful in 1m27s
Tests / test-deno (push) Successful in 1m50s
Tests / test-bun (push) Successful in 1m59s
Tests / test-node (node22) (push) Successful in 2m12s
Tests / test-node (node20) (push) Successful in 2m16s
Tests / test-node (node18) (push) Successful in 2m18s
Tests / test-web (chromium) (push) Successful in 2m14s
Tests / test-web (firefox) (push) Successful in 2m25s
Build and deploy typedoc / build (push) Successful in 6m16s
Tests / lint (push) Successful in 6m55s
Tests / e2e-deno (push) Successful in 53s
Tests / e2e (push) Successful in 48s
fix(wasm): remove vite-ignore annotation from result
2025-01-19 20:15:23 +03:00

22 lines
671 B
JavaScript

import * as fs from 'node:fs'
import { resolve } from 'node:path'
/** @type {import('@fuman/build/vite').CustomBuildConfig} */
export default () => {
return {
pluginsPre: [
{
name: 'remove-vite-ignore',
renderChunk(code) {
return code.replace('/* @vite-ignore */', '')
},
},
],
preparePackageJson({ packageJson }) {
packageJson.exports['./mtcute.wasm'] = './mtcute.wasm'
},
finalize({ packageDir, outDir }) {
fs.cpSync(resolve(packageDir, 'src/mtcute.wasm'), resolve(outDir, 'mtcute.wasm'))
},
}
}