This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-10-28
Channels
what is the best way to read in a text file in cljs?
i would like to use something like import raw from '../constants/foo.txt';
from https://stackoverflow.com/a/64788876
does the above line translate to (require '["../constants/foo.txt" :as data])
in shadow?
i tried but it seems not working.
i want code that not use "fs" from nodejs. or should i serve those data with http server, and use js/fetch instead?
> should i serve those data with http server, and use js/fetch instead? Depends on the size of the data. For small files it's completely fine to inline them.
👌 1
@U06B8J0AJ does your macro use shadow.resource/inline
? or your implement our reading utils?