enketo / enketo

Enketo web forms monorepo
Apache License 2.0
9 stars 15 forks source link

SCSS compilation error when consuming enketo-core from Vite project #14

Open hansmbakker opened 7 months ago

hansmbakker commented 7 months ago

Describe the bug When consuming the enketo-core SCSS using Vite, I get an import issue from https://github.com/enketo/enketo/blob/15e164eabec6d49319eb720e28470ed854f6dfdc/packages/enketo-core/src/widget/date/datepicker-extended.scss#L1

[vite:css] [sass] Can't find stylesheet to import.

The SCSS file assumes it is always in /packages/enketo-core (in the monorepo) but if you obtained the SCSS using npm install enketo-core --save then that path does not exist. Also, the reference in the SCSS file misses the css extension (it ends with .min).

To Reproduce

  1. Create a Vite project using npm create vite@latest
  2. Add enketo-core and sass as dependencies to package.json
  3. Run npm install and npm run dev
  4. Add <link rel="stylesheet" href="/node_modules/enketo-core/src/sass/plain/plain.scss" /> to your index.html

Expected behavior No SCSS compilation error when consuming enketo-core

Screenshots

image
lognaturel commented 7 months ago

Thanks for filing this issue and sorry about that! If you'd like to put in a PR to fix, that would be appreciated, otherwise we'll try to get to it soon.