nuxt / module-builder

Complete solution to build and ship Nuxt modules.
MIT License
212 stars 22 forks source link

fix: generate explicit type import/exports #184

Closed BobbieGoede closed 7 months ago

BobbieGoede commented 7 months ago

This PR depends on #183 as it is built on top of that branch.

I'm not sure how to change the other generated type files (eg. module.d.ts) to use verbatimModuleSyntax. Adding the following to the example module.ts:

import type { ModuleUtilOptions } from './utils'

export interface ModuleOptions {
  apiKey: string
  utilOptions?: ModuleUtilOptions
}

// rest not relevant

Will result in the following module.d.ts:

import { ModuleUtilOptions } from './utils.js';

interface ModuleOptions {
    apiKey: string;
    utilOptions?: ModuleUtilOptions;
}

// rest not relevant

Which ideally would use import type { ModuleUtilOptions } from './utils.js';, right? Also not sure why the .js file extension is added. 😅