rsnext/test/integration/url-imports/pages/ssg.js
Tobias Koppers 04e1e01f18
test, fix and document all possible import types for URL imports (#30165)
resolve absolute URLs in CSS when using urlImports
remove `[path]` from static static image output path
replace file-loader with asset module, remove file-loader
2021-10-25 01:54:16 +02:00

23 lines
486 B
JavaScript

import value from 'http://localhost:12345/value1.js'
const url = new URL(
'https://github.com/vercel/next.js/raw/canary/test/integration/production/public/vercel.png?_=ssg',
import.meta.url
)
export async function getStaticProps() {
return {
props: {
value,
url: url.pathname,
},
}
}
export default function Index({ value: staticValue, url: staticUrl }) {
return (
<div>
Hello {staticValue}+{value}+{staticUrl}+{url.pathname}
</div>
)
}