Structure of modules in config for typescript
See original GitHub issueWhat problem does this feature solve?
This could solve types definition for module options.
Example :
When we want load module like @nuxtjs/dotenv
with options, we could not have types definition for that options.
In code :
import NuxtConfiguration from '@nuxt/config'
const config: NuxtConfiguration = {
modules: [
['@nuxtjs/dotenv', {
systemvars: true
}]
]
}
export default config
Explain: With that we don’t have error but we don’t have types on systemvars
and could not define that types
What does the proposed changes look like?
For that i propose use object for modules.
With could like that :
modules: {
'@nuxtjs/dotenv': {}, // Without options
'@nuxtjs/dotenv': { // With options
systemvars: true
}
}
And with that on modules we could define types like :
declare module '@nuxt/config/types/module' {
export interface NuxtConfigurationModuleOptions {
'@nuxtjs/dotenv': {
systemvars?: boolean
}
}
}
<div align="right">This feature request is available on Nuxt community (#c9373)</div>Issue Analytics
- State:
- Created 4 years ago
- Comments:19 (9 by maintainers)
Top Results From Across the Web
Documentation - Module Resolution
How TypeScript resolves modules in JavaScript. ... Setting baseUrl informs the compiler where to find modules. All module imports with non-relative names ...
Read more >Organize code in TypeScript using modules
Modules are a type of design pattern in computer programming used to improve the readability, structure, and testability of code. They are ...
Read more >A TypeScript Project Structure Guide
Directory Structure, Module Resolution and Related Configuration Options · General tsconfig. · Output Options # · “package. · Initial Implementation ...
Read more >How To Use Modules in TypeScript
TypeScript offers support for creating and using modules with a unified syntax that is similar to the ES Module syntax, while allowing the ......
Read more >Setting up your TypeScript environment - ArcGIS Developers
compilerOptions.module - This is the module system used to compile the code. In this example we are compiling the output as ES modules...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@kevinmarrec @pi0 Remind: As my comment above, the order of module execution needs to be guaranteed.
Okay thanks @orblazer