postcss-px-to-viewport icon indicating copy to clipboard operation
postcss-px-to-viewport copied to clipboard

include 无效

Open lishichao1002 opened this issue 2 years ago • 13 comments

include无效,看了代码,1.1.1 tag的代码和master的代码不一样,1.1.1 1.1.0代码里面都没有include字符串

lishichao1002 avatar Aug 24 '22 15:08 lishichao1002

大佬太懒了,忘记发布最新版本了,npm上面的是老版本

ice-fortress avatar Sep 26 '22 08:09 ice-fortress

大佬太懒了,忘记发布最新版本了,npm上面的是老版本

朋友你好,我想问下你这个postcss-px-to-viewport支持vite创建的的vue3项目吗?

huangwenboha563 avatar Oct 18 '22 03:10 huangwenboha563

@huangwenboha563 支持的,我之前做项目也用过这个,你可以搜一下相关的配置,都差不多的

ice-fortress avatar Oct 18 '22 03:10 ice-fortress

等待着更新,太不方便了

markgong-gd avatar Oct 27 '22 06:10 markgong-gd

等待着更新,太不方便了

可以先用这个xy-postcss-px-to-viewport;使用最新的master分支;支持include选项

au1996 avatar Oct 27 '22 06:10 au1996

等待着更新,太不方便了

可以先用这个xy-postcss-px-to-viewport;使用最新的master分支;支持include选项

试了,根本不行

1014156094 avatar Nov 25 '22 04:11 1014156094

等待着更新,太不方便了

可以先用这个xy-postcss-px-to-viewport;使用最新的master分支;支持include选项

试了,根本不行

在windows目录中path分隔为反斜杠,在传入include/exclude参数需注意;举个栗子:

// postcss.config.js
// os: windows

const plugins = {
  autoprefixer: {},
  'xy-postcss-px-to-viewport': {
    exclude: [/\\node_modules\\/i],
    include: [/\\src\\views\\home\\/i]
  }
}

module.exports = () => {
  if (process.env.NODE_ENV === 'development') {
    delete plugins.autoprefixer
  } else {
   // 这里走 CICD 中 Linux 系统;如果你是本地 Windows 打包;注释掉下面两行 
    plugins['xy-postcss-px-to-viewport'].exclude = [/\/node_modules\//i]
    plugins['xy-postcss-px-to-viewport'].include = [/\/src\/views\/home\//i]
  }

  return {
    plugins
  }
}

au1996 avatar Nov 25 '22 06:11 au1996

npm更新了吗?

vaynevayne avatar Apr 25 '23 12:04 vaynevayne

求更新npm

renxueyan avatar May 24 '23 00:05 renxueyan

https://www.npmjs.com/package/postcss-px-to-viewport-wfc 这个npm包可以用,支持 include

William-WFC avatar Oct 20 '23 05:10 William-WFC

直接用github的master分支安装 npm install https://github.com/evrone/postcss-px-to-viewport.git --save-dev

UmbraCi avatar Jan 03 '24 08:01 UmbraCi

include option invalid, Is there any other plugin instead?

QinZhen001 avatar Jan 30 '24 13:01 QinZhen001

等待着更新,太不方便了

可以先用这个xy-postcss-px-to-viewport;使用最新的master分支;支持include选项

试了,根本不行

亲测该依赖可用,推荐这样写正则,分隔符引入依赖变量

import path from 'path';

const regSep = `\\${path.sep}`;
const includeFiles = [
  new RegExp(`${regSep}src${regSep}pages${regSep}StaticIndex${regSep}`),
  new RegExp(`${regSep}src${regSep}staticComponents${regSep}`),
  new RegExp(`${regSep}src${regSep}layouts${regSep}EnterLayout${regSep}`),
];

xhwgood avatar May 18 '24 08:05 xhwgood