We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
如题,官网的教程是基于cjs引入postcss-pxtransform的,现在用esm怎么引入
The text was updated successfully, but these errors were encountered:
好问题,现在这个项目实际上可以直接引入,因为这个 uni-app 项目实际上是直接在 vite.config.ts 里面内联的 postcss 插件,外面放个 postcss.config.ts 只是摆设而已。
你可以试试直接 import 或者 require, vite.config.ts 应该是做了这 2 种格式的处理的.
Sorry, something went wrong.
谢谢,这样写就可以了,之前没有类型提示,原来是用于测试的盒子宽高不相等
import tailwindcss from 'tailwindcss' import autoprefixer from 'autoprefixer' import type {AcceptedPlugin} from 'postcss' import cssMacro from 'weapp-tailwindcss/css-macro/postcss' import postcssPxtransform from 'postcss-pxtransform'; const plugins: AcceptedPlugin[] = [ tailwindcss(), autoprefixer(), postcssPxtransform({platform: 'weapp', designWidth: 750}) ] plugins.push(cssMacro) export default plugins
,顺带一提我也遇到了issues19相同问题,真机测试会爆红,不知道会不会对日后生产环境有影响
No branches or pull requests
如题,官网的教程是基于cjs引入postcss-pxtransform的,现在用esm怎么引入
The text was updated successfully, but these errors were encountered: