-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
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
postcss webpack 1 配置 #1101
Comments
看了下你的页面样式还是 px,并不是 rem,check下 px2rem 有没有生效 |
@paranoidjk test: /\.css$/,
loader: 'style!css?importLoaders=1!postcss',
postcss: [
pxtorem({
rootValue: 100,
propWhiteList: [],
})
] |
这里应该会加载 antd-mobile 的 css。 "plugins": [["import", { "style": "css", "libraryName": "antd-mobile" }]], check 下你 postcss-pxtorem 的版本,最新版本的配置方法不同。 |
@warmhug 抱歉,您给我的我看过了,可还是不太明白。 |
您好,我现在使用create-react-app创建一个demo,使用react-app-rewired插件(提供的config-overrides.js文件)扩展react脚手架内置webpack配置, `const { const pxtorem = require('postcss-pxtorem'); const fileLoaderMatcher = function(rule) { module.exports = function override(config, env) { // customize theme // css-modules // file-loader exclude return config; |
Environment(required) | 环境(必填)
What did you do? Please provide steps to re-produce your problem.(请提供复现步骤)
1.在index.html head中添加了以下代码:
2.在webpack中添加了postcss-pxtorem(我的是create-react-app 创建的)
What do you expected?(预期的正常效果)
自动适配屏幕
What happen?(发生了何种非正常现象)
iphone6下的和iphone6p下差别较大(iphone6p下 缩小过度)
(怕图片出不来,贴了个地址)
http://wxshop-auto.oss-cn-shanghai.aliyuncs.com/img/iphone-img.png
Re-producible online demo (可复现的在线demo)
下面的链接可在手机中演示,
http://mobilepos-staging.p2shop.cn/#/login?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhdWQiOiJwYW5ncGFuZ2phbiIsImIiOiJNSVVTT0wsQ2FsdmluIEtsZWluLFRlZCBCYWtlcixMaWxseSBQdWxpdHplciIsImV4cCI6MTQ5MTgwNDE0NiwiaXNzIjoiYWNjb3VudCIsIm5iZiI6MTQ5MTU0NDk0NiwiciI6IlNhbGVzbWFuLE1hbmFnZXIiLCJzaWQiOiIyMDAwMDAxIiwidGlkIjoiMTAiLCJ1Ijoic2FsZXN3b21hbiIsInVpZCI6IjEwMDAwMDEifQ.3-wdXX_MU0hMM74X-vWtoR41vy8KyizI_eJZRrDEu6U
The text was updated successfully, but these errors were encountered: