Replies: 1 comment
-
It sounds like you may not have the base vanilla extract css package installed. This is the setup that I have working:
Full example {
"name": "my-app",
"version": "0.0.0",
"sideEffects": false,
"exports": {
".": {
"types": "./src/index.tsx",
"import": "./dist/index.mjs",
"require": "./dist/index.js"
},
},
"main": "./dist/index.js",
"module": "./dist/index.esm.js",
"types": "./dist/index.d.ts",
"style": "./dist/index.css", //<- Add path to outputs
"files": [
"dist"
],
"scripts": {
"build": "tsup",
"dev": "tsup --watch",
},
"dependencies": {
"react": "^18.2.0"
},
"devDependencies": {
"@types/react": "^18.2.61",
"@types/react-dom": "^18.2.19",
"@vanilla-extract/css": "^1.17.4", //<- Add base package
"@vanilla-extract/esbuild-plugin": "^2.3.18", //<- Add esbuild plugin package
"tsup": "^8.0.2",
"typescript": "5.5.4"
}
} Full example import { defineConfig } from "tsup";
import { vanillaExtractPlugin } from "@vanilla-extract/esbuild-plugin";
export default defineConfig((options) => ({
entryPoints: ["src/index.tsx"],
format: ["cjs"],
watch: true,
esbuildPlugins: [vanillaExtractPlugin()], //<- Add vanillaExtractPlugin
...options,
})); |
Beta Was this translation helpful? Give feedback.
0 replies
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.
-
I'm trying to get this to work but unfortunately I run into issues. Just setting up the plugin like instructed by the docs doesn't work:
Neither does help setting/unsetting the
bundle
flag. No CSS files are generated and the.css.ts
files are included in the compiled files which is obviously throwing errors when imported. Any help or pointers? Link to vanilla-extract docsBeta Was this translation helpful? Give feedback.
All reactions