Skip to content
This repository has been archived by the owner on Jan 16, 2023. It is now read-only.

instantsearch.js: CSS is not included in production #386

Open
imphil opened this issue Jul 8, 2019 · 0 comments
Open

instantsearch.js: CSS is not included in production #386

imphil opened this issue Jul 8, 2019 · 0 comments
Labels

Comments

@imphil
Copy link
Contributor

imphil commented Jul 8, 2019

The CSS coming from the instantsearch.js bundle is included in search.js:

import 'instantsearch.js/dist/instantsearch.css'

That works fine in development builds (yarn dev), but doesn't work in production build (yarn build). In these builds, the CSS is simply not built.

It turns out that the ./node_modules/instantsearch.js/package.json specifies sideeffects: false, where it should actually specify

"sideEffects": [
  "*.css"
],

(Thanks to fkhadra/react-toastify#334 (comment) for the hint.)

Newer instantsearch.js versions (>= 3) use a different structure, so let's see if upgrading to a new version fixes things, otherwise we need to go with an upstream bug. For now, a workaround is sufficient.

@imphil imphil added the bug label Jul 8, 2019
imphil added a commit that referenced this issue Jul 8, 2019
imphil added a commit that referenced this issue Jul 8, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

1 participant