-
Notifications
You must be signed in to change notification settings - Fork 84
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Environment
TypeScript & Node.js
Reproduction
source code: https://github.com/zrosenbauer/viteval/blob/main/packages/cli/src/commands/data/command.ts
Describe the bug
I'm unable to have the globs recognized in the alias. I think this is due to the underlying pathe
library not supporting glob
.
I tested this directly in the jiti
codebase by adding a new test & fixture.
Here is example of what SHOULD work:
import { defineDataset } from 'viteval/dataset';
import testData from '#/data';
export default defineDataset({
name: 'example',
data: async () => {
console.log('TEST DATA', testData);
return [
{
input: 'Generate a random number between 0 and 100',
expected: 1,
...testData,
},
{
input: 'Generate a random number between 0 and 100',
expected: 2,
},
{
input: 'Generate a random number between 0 and 100',
expected: 3,
},
];
},
});
const jiti = createJiti(`file:${path.dirname(configFilePath)}`, {
fsCache: false,
moduleCache: false,
interopDefault: true,
sourceMaps: true,
alias: {
"#/*": "./src/*"
},
// tryNative: true,
transformOptions: {
// retainLines: true,
// filename: '',
ts: true,
},
});
It does work (sort of) if I remove the glob. I'll probably open a PR in my lib to hack/fix while this is being resolved.
Additional context
No response
Logs
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working