px调整倍数问题修复
This commit is contained in:
parent
cce1ddfa72
commit
1ed5af4681
|
|
@ -12,10 +12,11 @@ module.exports = postcss.plugin('postcss-px2rem', (option) => {
|
||||||
}, option)
|
}, option)
|
||||||
|
|
||||||
return (root, result) => {
|
return (root, result) => {
|
||||||
|
const file = root.source.input.file
|
||||||
const ignore = opt.ignore || []
|
const ignore = opt.ignore || []
|
||||||
const file = result.opts.from
|
|
||||||
for (const ignoreElement of ignore) {
|
for (const ignoreElement of ignore) {
|
||||||
if (file.indexOf(ignoreElement) >= 0) return
|
const regExp = new RegExp(ignoreElement)
|
||||||
|
if (regExp.test(file)) return
|
||||||
}
|
}
|
||||||
root.walkDecls(function (decl) {
|
root.walkDecls(function (decl) {
|
||||||
if (/px/.test(decl.value)) {
|
if (/px/.test(decl.value)) {
|
||||||
|
|
|
||||||
|
|
@ -63,6 +63,7 @@ export default {
|
||||||
</style>
|
</style>
|
||||||
<style lang='less' scoped>
|
<style lang='less' scoped>
|
||||||
.index {
|
.index {
|
||||||
|
|
||||||
width: 100vw;
|
width: 100vw;
|
||||||
height: 100vh;
|
height: 100vh;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@ module.exports = {
|
||||||
plugins: [
|
plugins: [
|
||||||
require('./buildPlugins/pxresize')({
|
require('./buildPlugins/pxresize')({
|
||||||
scale: 0.5,
|
scale: 0.5,
|
||||||
ignore: ['manager']
|
ignore: ['manager', 'node_modules']
|
||||||
})
|
})
|
||||||
]
|
]
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue