Skip to content

node package resolution not handled by @tsdown/css #811

@Mister-Hope

Description

@Mister-Hope

Reproduction link or steps

I am using the following:

    "@tsdown/css": "https://pkg.pr.new/@tsdown/css@810",
    "tsdown": "https://pkg.pr.new/tsdown@810",

tsdown could not resolve node packages like vite:

 ERROR  Error: Build failed with 1 error:

[plugin @tsdown/css] /Users/mister-hope/projects/vuepress-ecosystem/plugins/development/plugin-git/src/client/styles/changelog.scss
Error: Error: Can't find stylesheet to import.
  ╷
1 │ @use '@vuepress/helper/scss/svg';
  │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

For now, I must manually add a NodeImporter for sass:

    css: {
      inject: true,
      splitting: true,
      preprocessorOptions: {
        scss: {
          importers: [new NodePackageImporter()],
        },
      },
    },

And then use pkg: prefix:

@use 'pkg:@vuepress/helper/scss/svg';

What is expected?

tsdown should have basic node resolution support similar to vite.

What is actually happening?

.

Any additional comments?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Priority

    None yet

    Effort

    None yet

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions