Skip to content

Commit

Permalink
fix: allow users to override nitro error (#58)
Browse files Browse the repository at this point in the history
  • Loading branch information
danielroe authored Apr 12, 2022
1 parent 149ddca commit aa660c7
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 4 deletions.
5 changes: 3 additions & 2 deletions src/options.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { resolve } from 'pathe'
import { join, resolve } from 'pathe'
import { loadConfig } from 'c12'
import { klona } from 'klona/full'
import { camelCase } from 'scule'
Expand Down Expand Up @@ -54,7 +54,8 @@ const NitroDefaults: NitroConfig = {

// Rollup
alias: {
'#nitro': runtimeDir
'#nitro': runtimeDir,
'#nitro-error': join(runtimeDir, 'error')
},
unenv: {},
analyze: false,
Expand Down
1 change: 0 additions & 1 deletion src/rollup/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,6 @@ export const plugins = [
}
rollupConfig.plugins.push(alias({
entries: resolveAliases({
'#nitro': runtimeDir,
'#build': buildDir,
'~': nitro.options.srcDir,
'@/': nitro.options.srcDir,
Expand Down
2 changes: 1 addition & 1 deletion src/runtime/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { useRuntimeConfig } from './config'
import { timingMiddleware } from './timing'
import { cachedEventHandler } from './cache'
import { plugins } from '#nitro/virtual/plugins'
import handleError from '#nitro/error'
import handleError from '#nitro-error'
import { handlers } from '#nitro/virtual/server-handlers'

export interface NitroApp {
Expand Down
3 changes: 3 additions & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@
"#nitro/*": [
"./src/runtime/*"
],
"#nitro-error": [
"./src/runtime/error"
],
},
}
}

0 comments on commit aa660c7

Please sign in to comment.