Rollup emitFile
throws error when importing css.ts over package
#1433
Unanswered
flex-mookeun
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi there,
I'm trying to setup vanilla-extract in my monorepo based on rollup.
To provide a theme (including
createTheme
and maybesprinkle
) which should be available throughout the project, I chose to create a new package and servetheme.css.ts
directly rather than serving compiled result by the plugin.Then I get following error while building another package consuming the theme:
As far as I know, this is because referenced theme file is resolved with relative path (
../packages/theme/theme.css.ts
) by the consumer, and when the plugin creates css, relative path is not allowed as file name (of cource) by the rollupemitFile
API.Quick fix I tried was giving project root path as
cwd
param ofVanillExtractPlugin
to make the path non-relative. (e.g.../theme/theme.css.ts
topackages/theme/theme.css.ts
)I found this issue with the same error message,
but that was not monorepo case so I assume there could be better solution we can discuss.
Thanks in advance.
Beta Was this translation helpful? Give feedback.
All reactions