Unable to get rollup plugin to work with sprinkles in a monorepo setup #774
-
We have a monorepo setup and one of our packages called When trying to build a package that depends on
Has anyone worked with the rollup plugin with sprinkles and monorepos before that has gotten past these issues? Any advice would be much appreciated. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
Part of this issue was fixed by a TypeScript configuration change, not using esbuildOptions: {
plugins: [
{
name: 'empty-external-css-imports',
setup(build) {
build.onLoad({ filter: /\.css$/ }, () => ({ contents: '' }));
},
},
],
}, |
Beta Was this translation helpful? Give feedback.
-
I don't have path's in my tscofnig but use turbo repo and pnpm which is working with symlinks. my current workaround is this: plugins: [
vanillaExtractPlugin(),
{
transform(code) {
return code.replace(/(\.\.\/)+PACKAGE_PATH/g, 'node_modules/PACKAGE_NAME');
}
},
] replace |
Beta Was this translation helpful? Give feedback.
Part of this issue was fixed by a TypeScript configuration change, not using
paths
to resolve packages in the monorepo. This means that vanilla-extract doesn't see the.css.ts
imports in external packages. Then there was an issue with importing css in external packages, which was solved by passing an esbuild plugin to ignore css imports.