Closed akx closed 5 months ago
ast-types is required (https://github.com/tailwindlabs/prettier-plugin-tailwindcss/blob/efea6f924c2e57fa8f8169231e802466bb5fe9ce/src/index.ts#L6), but isn't declared as a dependency.
ast-types
When using e.g. pnpm, it doesn't get hoisted into node_modules from being recast's transitive dependency:
pnpm
node_modules
recast
$ pnpm why ast-types Legend: production dependency, optional only, dev only prettier-plugin-tailwindcss@0.6.5 /Users/akx/build/prettier-plugin-tailwindcss devDependencies: recast 0.20.5 └── ast-types 0.14.2
so build fails:
> node build.mjs --minify ✘ [ERROR] Could not resolve "ast-types" src/index.ts:6:26: 6 │ import * as astTypes from 'ast-types'
The same stands for @babel/types with a slightly different error (since it's not esbuild but dts complaining).
@babel/types
With these added, things work again:
$ git clean -fdx . -e .idea && pnpm i && pnpm build [...] Progress: resolved 607, reused 548, downloaded 0, added 548, done [...] DTS ⚡️ Build success in 516ms $
Thanks!
ast-types
is required (https://github.com/tailwindlabs/prettier-plugin-tailwindcss/blob/efea6f924c2e57fa8f8169231e802466bb5fe9ce/src/index.ts#L6), but isn't declared as a dependency.When using e.g.
pnpm
, it doesn't get hoisted intonode_modules
from beingrecast
's transitive dependency:so build fails:
The same stands for
@babel/types
with a slightly different error (since it's not esbuild but dts complaining).With these added, things work again: