Passing large csv files into statically-exported pages: pass in as query
?
#10762
Unanswered
erikdstock
asked this question in
Help
Replies: 1 comment 1 reply
-
You'll probably want to use #9524 when it's out. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'd like to pass all csvs in a
data/
directory into individual statically-exported pages, but i'm not clear on the best way to do it. In pseudocode terms i've been doing something like this:Then in my
getInitialProps
i do more complicated logic on the csv string, parsing it into an object and so on (this is not easy to do from next.config.js due to the stripped-down node environment).That said, this all feels weird. I'm coming from a gatsby background in part but wanted to try next since these csvs felt like they didn't call for a full graphql type system, but it feels like i'm doing something wrong to be assigning
csv
to a 'query' object. Am I missing something? Is there a much easier way to do things? Should i be waiting for thegetStaticProps
method?(also sorry for asking back-to-back questions)
Beta Was this translation helpful? Give feedback.
All reactions