Skip to content

Commit

Permalink
chore: make directory dynamic
Browse files Browse the repository at this point in the history
  • Loading branch information
immortal-tofu committed Oct 11, 2024
1 parent b2e9dcb commit f609bff
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions config/rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down Expand Up @@ -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],
Expand Down

0 comments on commit f609bff

Please sign in to comment.