@sanity/import is now ESM only
Published: October 2, 2025
v4.0.0
import
The import package is now ESM-only and has an updated minimum Node.js requirement. This change only impacts users of the @sanity/import
package.
Breaking Changes
Node.js 20+ Required
The minimum Node.js version is now 20.19.1 (or 22.12+ for Node 22). Node.js 18 is no longer supported.
ESM-only Package
The package is now pure ESM and no longer supports CommonJS. Additionally, named exports are now used - there is no default export anymore. The only exported method is named sanityImport
.
Before (v3):
const sanityImport = require('@sanity/import')
After (v4):
import {sanityImport} from '@sanity/import'