Skip to content

Commit

Permalink
Merge pull request #238 from ryoppippi/feature/resolve-path-for-windows
Browse files Browse the repository at this point in the history
fix: `resolve` id (fix #237)
  • Loading branch information
ryoppippi authored Jul 24, 2024
2 parents 1010c89 + d739f74 commit 28eb4a6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
3 changes: 2 additions & 1 deletion packages/unplugin-typia/src/core/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import type { UnpluginFactory, UnpluginInstance } from 'unplugin';
import { createUnplugin } from 'unplugin';
import { createFilter as rollupCreateFilter } from '@rollup/pluginutils';
import MagicString from 'magic-string';
import { resolve } from 'pathe';

import type { ResolvedOptions } from './options.ts';
import type { Options } from './options.js';
Expand Down Expand Up @@ -123,7 +124,7 @@ const unpluginFactory: UnpluginFactory<

async transform(_source, _id) {
const source = wrap<Source>(_source);
const id = wrap<ID>(_id);
const id = wrap<ID>(resolve(_id));

/** skip if source does not include typia */
if (!source.includes('typia')) {
Expand Down
3 changes: 1 addition & 2 deletions packages/unplugin-typia/src/core/typia.ts
Original file line number Diff line number Diff line change
Expand Up @@ -179,8 +179,7 @@ function transform(
},
);

const resolvedId = resolve(id);
const file = transformationResult.transformed.find(t => resolve(t.fileName) === resolvedId);
const file = transformationResult.transformed.find(t => resolve(t.fileName) === id);

if (file == null) {
throw new Error('No file found');
Expand Down

0 comments on commit 28eb4a6

Please sign in to comment.