diff --git a/postcss.config.js b/postcss.config.js index 8253759..f6f21c0 100644 --- a/postcss.config.js +++ b/postcss.config.js @@ -1,17 +1,12 @@ import postcss from 'postcss'; import pxToViewport from 'postcss-px-to-viewport'; -import { customPostCSSPlugin } from "./src/utils/custom-postcss-plugin.js"; // 替换为实际的路径 - -// 将 pxToViewport 应用到 navigation 文件夹下的文件 +//自定义路径中包含navigation才需要自定义px-to-viewport const customPxToViewportPlugin = postcss.plugin('custom-px-to-viewport', (options) => { const pxToViewportInstance = pxToViewport({ viewportWidth: options.viewportWidth, - // ... 其他 pxToViewport 参数,如果需要的话 }); - return (root, result) => { const file = result.opts.from; - // 确保路径中包含 navigation 文件夹 if (file && file.includes('navigation')) { pxToViewportInstance(root, result); } @@ -20,12 +15,8 @@ const customPxToViewportPlugin = postcss.plugin('custom-px-to-viewport', (option export default { plugins: [ - customPostCSSPlugin({ - // ... 你的自定义插件选项 - }), customPxToViewportPlugin({ viewportWidth: 1920, }), - // ... 其他通用 PostCSS 插件 ], };