airblade / stimulus-datepicker

Stimulus-powered accessible datepicker
https://airblade.github.io/stimulus-datepicker/
MIT License
66 stars 5 forks source link

fix css import with webpack #25

Open calunia opened 1 year ago

calunia commented 1 year ago

Hello, Actually, when i try to import the css with webpack encore, i got the error : Module not found: Error: Package path ./css/datepicker.css is not exported from package node_modules/stimulus-datepicker (see exports field in node_modules/stimulus-datepicker/package.json)

Change "exports": "./src/datepicker.js",

to

"files": [
    "css/",
    "src/"
  ],

Fix this issue for me but i don't know how i can run your tests :/ So i open this pr if it can help someone :) Thx Calunia

airblade commented 1 year ago

Thanks for this.

I really have no idea what I'm doing with package.json! There's plenty of documentation online but somehow it never quite explains anything.

I'll try this on my own app (which use import-maps) to check it keeps working.