Update module system
The "update module system" patch moves your application from CommonJS to ESM.
npx @adonisjs/upgrade-kit@latest upgrade-module-system
pnpm dlx @adonisjs/upgrade-kit@latest upgrade-module-system
Following are the steps performed by this patch.
-
Define
type = moduleinside thepackage.jsonfile. -
Make
tsconfig.jsonfile extend the new base config from@adonisjs/tsconfigpackage. -
Remove unnecessary known types from the
compilerOptions.typesarray.{"compilerOptions": {"types": ["@adonisjs/core","@adonisjs/repl","@adonisjs/session","@adonisjs/view","@adonisjs/shield","@adonisjs/lucid","@adonisjs/auth","@adonisjs/lucid-slugify","@adonisjs/drive-s3","@adonisjs/attachment-lite","@japa/preset-adonis/build/adonis-typings"]}}