s
This commit is contained in:
parent
69f0e265a6
commit
8e4713512a
@ -1,16 +0,0 @@
|
||||
// 使用 ES6 模块导入
|
||||
import postcss from 'postcss';
|
||||
|
||||
// 创建并导出插件
|
||||
export const customPostCSSPlugin = postcss.plugin('custom-postcss-plugin', (options) => {
|
||||
return (root, result) => {
|
||||
const file = result.opts.from; // 获取正在处理的文件的路径
|
||||
// 判断是否是目标文件
|
||||
if (file && file.includes(options.filename)) {
|
||||
// 执行特定的 PostCSS 操作
|
||||
root.walkRules((rule) => {
|
||||
rule.selectors = rule.selectors.map(selector => `.special-scope ${selector}`);
|
||||
});
|
||||
}
|
||||
};
|
||||
});
|
Loading…
Reference in New Issue
Block a user