kirklin / postcss-px-conversion

A plugin for PostCSS that generates viewport units (vw, vh, vmin, vmax) from pixel units. The best choice to create a scalable interface on different displays by one design size.
https://postcss-px-conversion.vercel.app
MIT License
26 stars 2 forks source link

AtRule is not a constructor #3

Open harlan1012 opened 1 month ago

harlan1012 commented 1 month ago

Describe the bug

image postcss版本:8.4.39 安装postcss-px-conversion后运行,报错”xxxAtRule is not a constructor“

Reproduction

plugins: [ autoprefixer(), postcssPxConversion({ unitType: 'px', unitPrecision: 5, viewportWidth: 375, viewportUnit: 'vw', fontViewportUnit: 'vw', allowedProperties: [''], excludedProperties: [], selectorBlacklist: [], minPixelValue: 1, allowMediaQuery: true, replaceRules: true, excludeFiles: [/pad-css.(scss|css|less)/, /uno.(scss|css|less)/], includeFiles: [], enableLandscape: true, landscapeUnit: 'vh', landscapeViewportWidth: 768, enablePerFileConfig: true, viewportWidthComment: 'viewport-width', }), postcssPxConversion({ unitType: 'px', unitPrecision: 5, viewportWidth: 375, viewportUnit: 'vw', fontViewportUnit: 'vw', allowedProperties: [''], excludedProperties: [], selectorBlacklist: [], minPixelValue: 1, allowMediaQuery: true, replaceRules: true, excludeFiles: [], includeFiles: [/pad-css.(scss|css|less)/], enableLandscape: true, landscapeUnit: 'vh', landscapeViewportWidth: 768, enablePerFileConfig: true, viewportWidthComment: 'viewport-width', }),]

System Info

System:
    OS: macOS 14.1
    CPU: (11) arm64 Apple M3 Pro
    Memory: 29.98 MB / 18.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 18.20.2 - ~/.nvm/versions/node/v18.20.2/bin/node
    Yarn: 1.22.21 - /opt/homebrew/bin/yarn
    npm: 10.5.0 - ~/.nvm/versions/node/v18.20.2/bin/npm
    pnpm: 8.12.0 - ~/Library/pnpm/pnpm
  Browsers:
    Chrome: 126.0.6478.127
    Safari: 17.1
    Safari Technology Preview: 18.0

Validations

kirklin commented 1 month ago

image 未复现问题,可以给一个最小实现吗