Description
Building a Runable module fails when one of its CSS entries contains a remote @import URL.
The @tsdown/css plugin appears to resolve the URL as a path relative to the CSS file instead of preserving it as an external CSS import.
Minimal reproduction
Create a Runable module with a CSS entry:
import { defineModule } from "runable";
export default defineModule({
css: ["./app/css/main.css"],
});
Add a remote import to app/css/main.css:
@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap");
@import "tailwindcss";
Then run:
Actual behavior
The build fails because the remote URL is interpreted as a local file path:
WARN [@tsdown/css] Failed to resolve import
'https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap'
Error: ENOENT: no such file or directory, open
'/path/to/project/app/css/https:/fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap'
Expected behavior
Remote CSS imports should either:
- remain unchanged in the generated CSS, or
- be treated as external resources and not passed to the local filesystem resolver.
Environment
- Runable:
1.1.0
@runablejs/cli: 1.1.0
@tsdown/css: 0.22.14
- Node.js:
24.19.0
- Package manager: pnpm
- OS: Linux
Workaround
Removing the remote @import allows the module to build successfully.
Using a locally packaged font would also avoid the issue, but remote CSS imports are valid CSS and should not be resolved as relative filesystem paths.
Description
Building a Runable module fails when one of its CSS entries contains a remote
@importURL.The
@tsdown/cssplugin appears to resolve the URL as a path relative to the CSS file instead of preserving it as an external CSS import.Minimal reproduction
Create a Runable module with a CSS entry:
Add a remote import to
app/css/main.css:Then run:
Actual behavior
The build fails because the remote URL is interpreted as a local file path:
Expected behavior
Remote CSS imports should either:
Environment
1.1.0@runablejs/cli:1.1.0@tsdown/css:0.22.1424.19.0Workaround
Removing the remote
@importallows the module to build successfully.Using a locally packaged font would also avoid the issue, but remote CSS imports are valid CSS and should not be resolved as relative filesystem paths.