Начат фронтенд
This commit is contained in:
42
node_modules/postcss/lib/processor.js
generated
vendored
42
node_modules/postcss/lib/processor.js
generated
vendored
@@ -1,16 +1,34 @@
|
||||
'use strict'
|
||||
|
||||
let Document = require('./document')
|
||||
let LazyResult = require('./lazy-result')
|
||||
let NoWorkResult = require('./no-work-result')
|
||||
let LazyResult = require('./lazy-result')
|
||||
let Document = require('./document')
|
||||
let Root = require('./root')
|
||||
|
||||
class Processor {
|
||||
constructor(plugins = []) {
|
||||
this.version = '8.5.6'
|
||||
this.version = '8.4.21'
|
||||
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) {
|
||||
@@ -40,24 +58,6 @@ class Processor {
|
||||
}
|
||||
return normalized
|
||||
}
|
||||
|
||||
process(css, opts = {}) {
|
||||
if (
|
||||
!this.plugins.length &&
|
||||
!opts.parser &&
|
||||
!opts.stringifier &&
|
||||
!opts.syntax
|
||||
) {
|
||||
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