Skip to content

Cannot resolve import './styles.scss' #456

@hyrious

Description

@hyrious

I have a vite project released as a front-end library, and I want to use the rolldown-plugin-dts to bundle types, the tsdown.config.ts:

import { defineConfig } from "tsdown";

export default defineConfig({
  entry: ["src/main.ts"],
  clean: false,
  dts: { emitDtsOnly: true, oxc: true },
});

Generates such output:

 ERROR  Error: Build failed with 1 error:

[plugin rolldown-plugin-dts:resolver]
RollupError: Cannot resolve import './styles.scss' from '/path/to/main.d.ts'

I guess the ignoreFiles trick in tsup can be applied here, which simply ignores (load as empty js) files that are not likely to have types.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions