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

feat: mkdir if parent dir does not exists #516

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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