Capítulo 423 de 456
Experimental feature letting you import modules directly from external URLs instead of local disk, gated behind an explicit allowlist of domains for security.
experimental.urlImports: array of allowed URL prefixes; only domains listed can be imported from.next.lock directory: contains a lockfile + fetched assets; must be committed to Git (not gitignored).next dev downloads and adds new URL imports to the lockfile; next build uses only the lockfile (no network needed, except no-cache resources which always refetch).module.exports = {
experimental: {
urlImports: ['https://example.com/assets/', 'https://cdn.skypack.dev'],
},
}
import confetti from 'https://cdn.skypack.dev/canvas-confetti'
next.lock no Git: quebra reprodutibilidade de build, já que next build depende só do lockfile.url()), imagens estáticas (next/image) e asset imports via new URL(...).