mirror of
https://gitee.com/onvia/ccc-tnt-psd2ui
synced 2025-12-08 22:08:46 +00:00
mac npm-packages
This commit is contained in:
@@ -7,28 +7,10 @@ let Root = require('./root')
|
||||
|
||||
class Processor {
|
||||
constructor(plugins = []) {
|
||||
this.version = '8.4.20'
|
||||
this.version = '8.4.29'
|
||||
this.plugins = this.normalize(plugins)
|
||||
}
|
||||
|
||||
use(plugin) {
|
||||
this.plugins = this.plugins.concat(this.normalize([plugin]))
|
||||
return this
|
||||
}
|
||||
|
||||
process(css, opts = {}) {
|
||||
if (
|
||||
this.plugins.length === 0 &&
|
||||
typeof opts.parser === 'undefined' &&
|
||||
typeof opts.stringifier === 'undefined' &&
|
||||
typeof opts.syntax === 'undefined'
|
||||
) {
|
||||
return new NoWorkResult(this, css, opts)
|
||||
} else {
|
||||
return new LazyResult(this, css, opts)
|
||||
}
|
||||
}
|
||||
|
||||
normalize(plugins) {
|
||||
let normalized = []
|
||||
for (let i of plugins) {
|
||||
@@ -58,6 +40,24 @@ class Processor {
|
||||
}
|
||||
return normalized
|
||||
}
|
||||
|
||||
process(css, opts = {}) {
|
||||
if (
|
||||
this.plugins.length === 0 &&
|
||||
typeof opts.parser === 'undefined' &&
|
||||
typeof opts.stringifier === 'undefined' &&
|
||||
typeof opts.syntax === 'undefined'
|
||||
) {
|
||||
return new NoWorkResult(this, css, opts)
|
||||
} else {
|
||||
return new LazyResult(this, css, opts)
|
||||
}
|
||||
}
|
||||
|
||||
use(plugin) {
|
||||
this.plugins = this.plugins.concat(this.normalize([plugin]))
|
||||
return this
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = Processor
|
||||
|
||||
Reference in New Issue
Block a user