Closed AriPerkkio closed 2 weeks ago
Not sure why but seems to be caused by spreading ...unoCSSConfig
instead of using the variables from import { rules, shortcuts, theme } from "@tutorialkit/theme";
The UnoCSS config could also be made into a preset if that's easier:
presetTutorialKit.ts
import { definePreset } from "unocss"
import { rules, shortcuts, theme } from "@tutorialkit/theme";
export default definePreset(() => {
return {
name: 'presetTutorialKit',
rules,
shortcuts,
theme
}
})
uno.config.ts
(removing ...unoCSSConfig
)
presets: [
presetUno({
dark: {
dark: '[data-theme="dark"]',
},
}),
presetTutorialKit(),
I think this is happening when unocss
imports the uno.config.ts
, and that file imports '@tutorialkit/astro'
that has imports for Astro stuff. Not sure why unocss
decides to use CJS here.
We are planning to move most, if not all (?) uno.config.ts
inside @tutorialkit/*
packages so that end-users wouldn't have to maintain that file. Ideally tutorials wouldn't even have to create uno.config.ts
unless they explicitly wanted to extend that. There's some discussion on https://github.com/stackblitz/tutorialkit/issues/144.
Describe the bug
When TutorialKit is started in development or build mode, Vite's CJS build entrypoint error is shown:
Steps to reproduce
Expected behavior
No warning should be shown
Platform