px2rem-postcss
px2rem-postcss copied to clipboard
增加parse参数,不改变postcss的ast结构
详细起因经过点这里:https://github.com/vitejs/vite/pull/7186 这里是简要描述:
- postcss的parse一般会接受参数opts,并且生成的ast的某些值依赖opts https://github.com/postcss/postcss/blob/24f2efc9a36d31c7a0cdf884804d3cfaea024be2/lib/parse.js#L7
- 我们这里没有传opts,导致ast少了属性
input.file
,而我在用的vite
里的vite-url-plugin
插件强依赖了这个属性导致最终打包出问题 - 我觉得ast还是不应该受到影响的,所以做了这个修改
感谢大佬