Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a switch for build dir, and copy only the resulting wasm file to the path #169

Open
Jieiku opened this issue Apr 10, 2023 · 2 comments

Comments

@Jieiku
Copy link
Collaborator

Jieiku commented Apr 10, 2023

Currently when I build for a Zola site I do this:

tinysearch --optimize --path static public/data_tinysearch/index.html

The result is that 7 files are generated:

2023-04-09_19-42-19

I would like a way for all those files to go to a temp/build directory, and only output the tinysearch_engine_bg.wasm, as far as I can tell that is the only file I require for the search to work. (that and my tinysearch.js file)

I debated even opening this report because I can probably just specify /tmp as the directory and then copy the wasm file from there... but I am curious what others think.

Edit: Here is what I am now doing instead:

cd ~/.dev/abridge
zola build
mkdir -p tmp && tinysearch --optimize --path tmp public/data_tinysearch/index.html && rsync -avz tmp/*.wasm static/ && rm -rf tmp
@mre
Copy link
Member

mre commented Apr 12, 2023

Good point. I wonder if we should introduce a new flag, which skips creating those sample files. Maybe --prod?

@Jieiku
Copy link
Collaborator Author

Jieiku commented Apr 12, 2023

That sounds perfect, I might have time to submit a pull request tonight.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants