Skip to content

vp test doesn't pick up loader configuration for vp pack #2175

Description

@gBasil

Describe the bug

I have a basic package that imports a .txt file as text (pack: { loader: { ".txt": "text" } }) that I build with vp pack. It successfully builds, as expected, but when trying to run tests with vp test, the file does not get imported properly, and instead of returning the text file, the .txt import returns the file path from the project root.

Reproduction

https://github.com/gBasil/vp-test-loader-repro

Steps to reproduce

vp install

# Observe that the package builds properly:
vp pack

# Observe that it fails
vp test

System Info

VITE+ - The Unified Toolchain for the Web

Environment:
  Version  24.18.0
  Source   lts

Tool Paths:
  node  /Users/basil/.vite-plus/js_runtime/node/24.18.0/bin/node
  npm   /Users/basil/.vite-plus/js_runtime/node/24.18.0/bin/npm
  npx   /Users/basil/.vite-plus/js_runtime/node/24.18.0/bin/npx

Package Manager:
  Name          pnpm
  Version       11.13.0
  Source        devEngines.packageManager
  Source Path   /Users/basil/Downloads/vp-error/package.json
  Project Root  /Users/basil/Downloads/vp-error
  Bin Path      /Users/basil/.vite-plus/package_manager/pnpm/11.13.0/pnpm/bin/pnpm

---

VITE+ - The Unified Toolchain for the Web

vp v0.2.4

Local vite-plus:
  vite-plus  v0.2.4

Tools:
  vite             v8.1.3
  rolldown         v1.1.4
  vitest           v4.1.10
  oxfmt            v0.57.0
  oxlint           v1.72.0
  oxlint-tsgolint  v0.24.0
  tsdown           v0.22.3

Environment:
  Package manager  pnpm v11.13.0
  Node.js          v24.18.0

Used Package Manager

pnpm

Logs

Validations

Metadata

Metadata

Assignees

No one assigned

    Type

    Fields

    Priority

    None yet

    Effort

    None yet

    Target date

    None yet

    Start date

    None yet

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions