From f609bff84ad7d9b126f73e19f757649a41eafcbc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20=27birdy=27=20Danjou?= Date: Fri, 11 Oct 2024 12:08:52 +0200 Subject: [PATCH] chore: make directory dynamic --- config/rollup.config.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/config/rollup.config.js b/config/rollup.config.js index 5d7501a..dd71697 100644 --- a/config/rollup.config.js +++ b/config/rollup.config.js @@ -8,9 +8,15 @@ import replace from '@rollup/plugin-replace'; import resolve from '@rollup/plugin-node-resolve'; import commonjs from '@rollup/plugin-commonjs'; import nodePolyfills from 'rollup-plugin-polyfill-node'; +import path from 'path'; +import fs from 'fs'; const require = createRequire(import.meta.url); +const wasmBindgenRayon = fs.readdirSync( + path.resolve('node_modules/tfhe/snippets'), +)[0]; + const nodePlugins = [ json(), wasm(), @@ -56,11 +62,10 @@ export default [ plugins: [...webPlugins], }, { - input: - './node_modules/tfhe/snippets/wasm-bindgen-rayon-3e04391371ad0a8e/src/workerHelpers.worker.js', + input: `./node_modules/tfhe/snippets/${wasmBindgenRayon}/src/workerHelpers.worker.js`, output: { file: 'lib/workerHelpers.worker.js', - name: 'fhevm', + name: 'worker', format: 'es', }, plugins: [...webPlugins],