react-code-dataset / next.js /test /integration /build-trace-extra-entries /app /pages /image-import.js
Download next.js/test/integration/build-trace-extra-entries/app/pages/image-import.js from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 499 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/next.js/test/integration/build-trace-extra-entries/app/pages/image-import.js
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/next.js/test/integration/build-trace-extra-entries/app/pages/image-import.js
-
curl -L -o image-import.js https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/next.js/test/integration/build-trace-extra-entries/app/pages/image-import.js
499 Bytes
| import fs from 'fs' | |
| import path from 'path' | |
| import Image from 'next/image' | |
| import testImage from '../public/test.jpg' | |
| export default function Page(props) { | |
| return ( | |
| <div> | |
| <Image src={testImage} placeholder="blur" alt="test" /> | |
| </div> | |
| ) | |
| } | |
| export function getServerSideProps() { | |
| try { | |
| // this should be included in the trace since it's not an | |
| // import | |
| fs.readFileSync(path.join(process.cwd(), 'public/another.jpg')) | |
| } catch (_) {} | |
| return { | |
| props: {}, | |
| } | |
| } | |