Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: generate explicit type import/exports #184

Merged

Conversation

BobbieGoede
Copy link
Member

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. 😅

@BobbieGoede BobbieGoede changed the title fix: use module verbatim module syntax fix: useverbatimModuleSyntax Nov 7, 2023
@BobbieGoede BobbieGoede changed the title fix: useverbatimModuleSyntax fix: use verbatimModuleSyntax Nov 7, 2023
@danielroe danielroe changed the title fix: use verbatimModuleSyntax fix: generate explicit type import/exports Nov 8, 2023
@danielroe danielroe merged commit b661692 into nuxt:main Nov 8, 2023
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants