Skip to content

Commit

Permalink
feat: mkdir if parent dir does not exists (#516)
Browse files Browse the repository at this point in the history
  • Loading branch information
tmg0 authored Jan 21, 2025
1 parent 7c4a8ae commit 6bea24a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion e2e/routes.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ describe('e2e routes', () => {
it('generates the routes', async () => {
const context = createRoutesContext(
resolveOptions({
// dts: join(__dirname, './__types.d.ts'),
// dts: join(__dirname, './.types/__types.d.ts'),
dts: false,
logs: false,
watch: false,
Expand Down
3 changes: 2 additions & 1 deletion src/core/context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { generateRouteNamedMap } from '../codegen/generateRouteMap'
import { MODULE_ROUTES_PATH, MODULE_VUE_ROUTER_AUTO } from './moduleConstants'
import { generateRouteRecord } from '../codegen/generateRouteRecords'
import fg from 'fast-glob'
import { relative, resolve } from 'pathe'
import { dirname, relative, resolve } from 'pathe'
import { ServerContext } from '../options'
import { getRouteBlock } from './customBlock'
import {
Expand Down Expand Up @@ -252,6 +252,7 @@ if (import.meta.hot) {
if (dts) {
const content = generateDTS()
if (lastDTS !== content) {
await fs.mkdir(dirname(dts), { recursive: true })
await fs.writeFile(dts, content, 'utf-8')
logger.timeLog('writeConfigFiles', 'wrote dts file')
lastDTS = content
Expand Down

0 comments on commit 6bea24a

Please sign in to comment.