aleph.js icon indicating copy to clipboard operation
aleph.js copied to clipboard

Use Official PostCSS Deno Pkg

Open shadowtime2000 opened this issue 4 years ago • 8 comments
trafficstars

It seems like PostCSS has an official Deno package, but it is currently lacking Typescript support. We could do some sort of type casting to get some types, or we could wait until it gets Typescript type support.

shadowtime2000 avatar Dec 20 '20 06:12 shadowtime2000

Might be worth looking into possible incompatibilities with esm.sh and the PostCSS Deno plugin, but if esm.sh is working properly (and it probably is) they should be close to entirely compatible.

shadowtime2000 avatar Dec 20 '20 08:12 shadowtime2000

that makes sense to use deno.land/x/postcss since alephjs works on Deno, the problem is that many plugins are not compatible with deno, for example if we import autoprefixer from 'https://esm.sh/autoprefixer' it will import the dependent post-css again.

ije avatar Dec 20 '20 08:12 ije

and esm.sh also provides the types declaration from https://cds.esm.sh/v11/[email protected]/lib/postcss.d.ts

ije avatar Dec 20 '20 08:12 ije

that makes sense to use deno.land/x/postcss since alephjs works on Deno, the problem is that many plugins are not compatible with deno, for example if we import autoprefixer from 'https://esm.sh/autoprefixer' it will import the dependent post-css again.

Would an NPM package redirect option for esm.sh work? https://esm.sh/autoprefixer?redirect-postcss=https://deno.land/x/postcss/mod.ts

shadowtime2000 avatar Dec 20 '20 08:12 shadowtime2000

good idea, i will extend the external option to support this:

"https://esm.sh/autoprefixer?external=postcss@https://deno.land/x/[email protected]/mod.ts"

ije avatar Dec 20 '20 08:12 ije

@ije I see that there is an external thing for other NPM packages so it works for stuff like peer dependencies or something, but is an ?external option made that allows us to use the Deno PostCSS package?

shadowtime2000 avatar Jan 11 '21 17:01 shadowtime2000

not yet, the week will update it.

ije avatar Jan 11 '21 23:01 ije