文件操作 - prefix-style-selectors.js
返回文件管理
返回主菜单
删除本文件
文件: /var/www/OLD/node_modules/svg-baker/lib/transformations/prefix-style-selectors.js
编辑文件内容
const Promise = require('bluebird'); const decodeEntities = require('he').decode; const postcss = require('postcss'); const prefixSelectors = require('postcss-prefix-selector'); /** * @return {Function} PostHTML plugin */ function prefixStyleSelectors(prefix) { return (tree) => { const styleNodes = []; tree.match({ tag: 'style' }, (node) => { styleNodes.push(node); return node; }); return Promise.map(styleNodes, (node) => { const content = node.content ? decodeEntities(node.content.join('')) : ''; return postcss() .use(prefixSelectors({ prefix })) .process(content) .then(prefixedStyles => node.content = prefixedStyles.css); }).then(() => tree); }; } module.exports = prefixStyleSelectors;
修改文件时间
将文件时间修改为当前时间的前一年
删除文件