mirror of
https://github.com/CompassConnections/Compass.git
synced 2026-04-04 06:51:45 -04:00
Ignore getStaticProps and getStaticPaths for mobile webview build
This commit is contained in:
@@ -27,4 +27,19 @@ cd web
|
||||
|
||||
rm -rf .next
|
||||
|
||||
# Hack to ignore getStaticProps and getStaticPaths for mobile webview build
|
||||
# as Next.js doesn't support SSR / ISR on mobile
|
||||
USERNAME_PAGE=pages/[username]/index.tsx
|
||||
|
||||
# rename getStaticProps to _getStaticProps
|
||||
sed -i.bak 's/\bgetStaticProps\b/_getStaticProps/g' $USERNAME_PAGE
|
||||
|
||||
# rename getStaticPaths to _getStaticPaths
|
||||
sed -i.bak 's/\bgetStaticPaths\b/_getStaticPaths/g' $USERNAME_PAGE
|
||||
|
||||
yarn build
|
||||
|
||||
sed -i.bak 's/\b_getStaticProps\b/getStaticProps/g' $USERNAME_PAGE
|
||||
|
||||
# rename getStaticPaths to _getStaticPaths
|
||||
sed -i.bak 's/\b_getStaticPaths\b/getStaticPaths/g' $USERNAME_PAGE
|
||||
|
||||
Reference in New Issue
Block a user