Skip to content

Build fails with tsconfig path alias (@/*) #266

@paul90317

Description

@paul90317

Description:
Using TypeScript path aliases like @/enum/tags works in VSCode, but sand build fails:

Error: Cannot find module '@/enum/tags'

Steps to Reproduce:

  1. tsconfig.json:
{
  "compilerOptions": {
    "baseUrl": ".",
    "paths": {
      "@/*": ["src/*"]
    }
  }
}
  1. Code using the alias:
// src/enum/tags.ts
import { Tag } from 'sandstone';

export const ENIMY = Tag('entity_types', 'enimy', [
    "#skeletons",
    "minecraft:zombie",
    "minecraft:piglin",
    "spider",
    "enderman",
    "shulker",
    "drowned",
    "husk",
    "stray",
]);

// some other file
import { ENIMY } from '@/enum/tags';
  1. Run build:
pnpm build

Expected:
Sandstone should resolve the alias like TypeScript does.

Environment:

  • Sandstone CLI: 0.5.4
  • OS: Windows

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions