webpack support #2431
Replies: 3 comments 7 replies
-
|
This is a one-size-does-not-fit-all situation. Anyway, I will think about it and if anyone has some expertise, feel free to jump in. |
Beta Was this translation helpful? Give feedback.
-
|
I guess one workaround is to use cjs build with const { atom } = require('jotai');If you don't prefer the require syntax, I think you can configure webpack to use cjs build instead of esm. Though, our cjs build is es5, so it might not be ideal. I wonder if there a way to configure webpack so that it replaces |
Beta Was this translation helpful? Give feedback.
-
|
Until webpack/webpack#15833 lands, https://ci.codesandbox.io/status/pmndrs/jotai/pr/2434 |
Beta Was this translation helpful? Give feedback.

Uh oh!
There was an error while loading. Please reload this page.
-
Summary
Hi, I noticed that
window.__NUMBER_OF_JOTAI_INSTANCES__was injected into our console. From a look at the details, I'm guessing that this is a vite thing where they inject an environment variable. However we use webpack that doesn't have this automatically happen. Is there a way to handle the traditional webpack case (where it would typically use process.env.NODE_ENV === 'production')Link to reproduction
N/A
Beta Was this translation helpful? Give feedback.
All reactions