Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tsup fails to generate dts with --dts-only mode when there are scss files imported in my entry #554

Closed
laozhu opened this issue Jan 30, 2022 · 1 comment
Labels

Comments

@laozhu
Copy link

laozhu commented Jan 30, 2022

Hello, @egoist I encount a problem with dts-only usage.

  1. I use vite to bundle my react-app with scss
  2. I want to use tsup to bundle my types to single dts file

But tsup will failed to work because it can't parse scss file in my component.

My CLI

tsup src/index.ts --dts-only -d dist

Error Message

> @easynm/react-gallery@1.0.0 build-dts /Users/Ritchie/Developer/@easynm/cloud/components/react-gallery
> tsup src/index.ts --dts-only -d dist

CLI Building entry: src/index.ts
CLI Using tsconfig: tsconfig.json
CLI tsup v5.11.11
DTS Build start
DTS Build error
Error parsing: /Users/Ritchie/Developer/@easynm/cloud/components/react-gallery/src/styles/react-gallery.scss:1:0
Unexpected character '@' (Note that you need plugins to import files that are not JavaScript)
1: @keyframes gallery-loading-spinner {
   ^
2:   0% {
3:     transform: rotate(0deg);
 ELIFECYCLE  Command failed with exit code 1.
 ELIFECYCLE  Command failed with exit code 1.

What I want

I want to ignore less/scss parse when I use --dts-only option, hope for ur help, Happly Lunar New Year 🐯

@laozhu laozhu changed the title tsup failed to generate dts with --dts-only mode when there are scss files imported in my entry Tsup fails to generate dts with --dts-only mode when there are scss files imported in my entry Jan 30, 2022
@egoist egoist closed this as completed in 20fb72b Jan 30, 2022
@github-actions
Copy link

🎉 This issue has been resolved in version 5.11.13 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant