This is an example Vite project using Lit 2, Typescript, and SASS imports.
- Changed Lit 1 implementation to Lit 2
- Added the
rollup-plugin-postcss-litplugin tovite.config.ts npm i -D sass- Added
typings/scss.d.ts - Moved styles from
src/my-element.tstosrc/my-element.scssand imported them - Added the
typingsfolder totsconfig.json - Added
"skipLibCheck": truetotsconfig.jsonto override Vite's.scssfile typings
N.B. Since Lit does not yet handle HMR, Vite triggers a full reload for Lit files, but SASS files currently only trigger an hot module reload (HMR) which will not update Lit without manually triggering a reload. Follow this issue for more details or wait until Lit HMR is released.