Open yuche opened 8 months ago
When this first got popular, I released a dual package version, but later went back to ESM only as I don't see why projects can't use ESM when they are new enough to deploy UnoCSS. It's like rejecting const foo = 'bar'
while using Array.prototype.at
.
As for your case, I doubt CodeSandbox, being a fairly popular service, doesn't support ESM. It's more like a config mistake. Could you provide a reproducible link?
When this first got popular, I released a dual package version, but later went back to ESM only as I don't see why projects can't use ESM when they are new enough to deploy UnoCSS. It's like rejecting
const foo = 'bar'
while usingArray.prototype.at
.As for your case, I doubt CodeSandbox, being a fairly popular service, doesn't support ESM. It's more like a config mistake. Could you provide a reproducible link?
Repro:
vite-react-ts-temaplte
: https://codesandbox.io/p/sandbox/q4fmnk?file=%2Fvite.config.ts%3A5%2C48&utm_medium=sandpackvite-react-template
: https://codesandbox.io/p/sandbox/6f3gwy?file=%2Fvite.config.js%3A16%2C1&utm_medium=sandpackNote that changing vite.config.js
or vite.config.ts
to vite.config.mjs
seems to work, but in reality it will only work within CodeSandbox website itself, not if you use sandpack
.
you can use import 'daisyui/dist/full.css';
in main.ts
you can use
import 'daisyui/dist/full.css';
in main.ts
Yes I can do that. But the reason for using this plugin is that I want the packaged files to be as small as possible, otherwise why would I use vite?
In some cases, vite is running in commonjs and developers are not authorised to change it. eg. Same CodeSandbox container. This can cause an error to be reported:
unocss-preset-daisy
should provided a CommonJS build and specify the values ofimport
andrequire
inpackages.json#exports
like this.