Skip to content

Instantly share code, notes, and snippets.

@hmmhmmhm
Created October 1, 2021 06:52
Show Gist options
  • Select an option

  • Save hmmhmmhm/3f7aa706cb807ec46ac051aa294b2d60 to your computer and use it in GitHub Desktop.

Select an option

Save hmmhmmhm/3f7aa706cb807ec46ac051aa294b2d60 to your computer and use it in GitHub Desktop.
import Router from 'next/router'
import { useEffect } from 'react'
export default function StaticRoute() {
useEffect(() => {
Router.replace(window.location.pathname, window.location.pathname, {
shallow: true
})
}, [])
return null
}
@hmmhmmhm

hmmhmmhm commented Oct 1, 2021

Copy link
Copy Markdown
Author
rm -rf ./out
npm run build && npm run export
rm -rf ./out_aws
cp -R out out_aws
cd  out_aws && find ./ -depth -name "*.html" -exec sh -c 'mv "$1" "${1%.html}"' _ {} \; & cd ..
aws s3 sync —include "*" —acl public-read —follow-symlinks —delete ./out_aws s3://주소
aws s3 cp —include "*" —exclude "*.*" —content-type="text/html"  —recursive s3://주소 s3://주소 —acl public-read —follow-symlinks
aws cloudfront create-invalidation —distribution-id 배포주소 —paths "/*"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment