URL Imports
Then, you can import modules directly from URLs:
import { a, b, c } from 'https://example.com/modules/some/module.js'
This feature is being designed with security as the top priority. To start, we added an experimental flag forcing you to explicitly allow the domains you accept URL imports from. We’re working to take this further by limiting URL imports to execute in the browser sandbox using the .
- When running
next build
, Next.js will use only the lockfile to build the application for production
Typically, no network requests are needed and any outdated lockfile will cause the build to fail. One exception is resources that respond with Cache-Control: no-cache
. These resources will have a no-cache
entry in the lockfile and will always be fetched from the network on each build.
import logo from 'https://github.com/vercel/next.js/raw/canary/test/integration/production/public/vercel.png'
export default () => (
<div>
<Image src={logo} placeholder="blur" />
</div>
const logo = new URL(
'https://github.com/vercel/next.js/raw/canary/test/integration/production/public/vercel.png',
import.meta.url
)
export default () => <div>{logo.pathname}</div>