mirror of https://gitlab.com/curben/blog
refactor(cssFilter): replace micromatch with String.endsWith()
This commit is contained in:
parent
8292e31140
commit
4b77924e2d
|
@ -10,13 +10,12 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
const autoprefixer = require('autoprefixer')
|
const autoprefixer = require('autoprefixer')
|
||||||
const micromatch = require('micromatch')
|
|
||||||
const normalize = require('postcss-normalize')
|
const normalize = require('postcss-normalize')
|
||||||
const postcss = require('postcss')
|
const postcss = require('postcss')
|
||||||
|
|
||||||
hexo.extend.renderer.register('css', 'css', (data, options) => {
|
hexo.extend.renderer.register('css', 'css', (data, options) => {
|
||||||
if (data.path) {
|
if (data.path) {
|
||||||
if (micromatch.isMatch(data.path, '*.min.css', { basename: true })) return data.text
|
if (data.path.endsWith('.min.css')) return data.text
|
||||||
}
|
}
|
||||||
|
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
|
|
Loading…
Reference in New Issue