Skip to content

Commit

Permalink
feat: allow using extends alongside with preset
Browse files Browse the repository at this point in the history
  • Loading branch information
pi0 committed Sep 1, 2022
1 parent 679e356 commit 6a43985
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 17 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
"@rollup/pluginutils": "^4.2.1",
"@vercel/nft": "^0.22.0",
"archiver": "^5.3.1",
"c12": "^0.2.9",
"c12": "^0.2.10",
"chalk": "^5.0.1",
"chokidar": "^3.5.3",
"consola": "^2.15.3",
Expand Down
17 changes: 2 additions & 15 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion src/options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ export async function loadOptions (userConfig: NitroConfig = {}): Promise<NitroO
defaults: NitroDefaults,
cwd: userConfig.rootDir,
dotenv: userConfig.dev,
extend: { extendKey: ['extends', 'preset'] },
resolve (id: string) {
type PT = Map<String, NitroConfig>
let matchedPreset = (PRESETS as any as PT)[id] || (PRESETS as any as PT)[camelCase(id)]
Expand All @@ -114,7 +115,7 @@ export async function loadOptions (userConfig: NitroConfig = {}): Promise<NitroO
},
overrides: {
...userConfig,
extends: [preset]
preset
}
})
const options = klona(config) as NitroOptions
Expand Down

0 comments on commit 6a43985

Please sign in to comment.