ModyQyW/vite-plugin-stylelint

Error: Dynamic require of "stylelint" is not supported

Closed this issue · 7 comments

pnpm create vite my-vue-app --template vue-ts
pnpm install stylelint@^14 -D
pnpm install vite-plugin-stylelint -D
plugins: [vue(), StylelintPlugin()]
pnpm run dev

details:

image

I'm not sure if it's a problem with upgrading vite to 3.0.0

I have updated 5 projects to vite 3 but haven't seen such error. I need some time to research.

Removing type: "module" in package.json should be a solution.

This package is bundled by tsup (esbuild underhood) and targets at node12. Please track evanw/esbuild#2067, evanw/esbuild#1921 and evanw/esbuild#2111.

Maybe change to unbuild in the future if necessary, since official plugins have changed to unbuild already.

I understand, thank you for your support

Please change to unbuild!!!

type: "module" support should be fixed in v3.0.3. Please have a try.

I don't have much time to change to unbuild recently. PR welcome.