2. Upgrade Module System

Update module system

The "update module system" patch moves your application from CommonJS to ESM.

npx @adonisjs/upgrade-kit@latest upgrade-module-system

Following are the steps performed by this patch.

  • Define type = module inside the package.json file.

  • Make tsconfig.json file extend the new base config from @adonisjs/tsconfig package.

  • Remove unnecessary known types from the compilerOptions.types array.

    "compilerOptions": {
    "types": [