(...args)
| 29 | postcss.plugin = function plugin(name, initializer) { |
| 30 | let warningPrinted = false |
| 31 | function creator(...args) { |
| 32 | // eslint-disable-next-line no-console |
| 33 | if (console && console.warn && !warningPrinted) { |
| 34 | warningPrinted = true |
| 35 | // eslint-disable-next-line no-console |
| 36 | console.warn( |
| 37 | name + |
| 38 | ': postcss.plugin was deprecated. Migration guide:\n' + |
| 39 | 'https://evilmartians.com/chronicles/postcss-8-plugin-migration' |
| 40 | ) |
| 41 | if (process.env.LANG && process.env.LANG.startsWith('cn')) { |
| 42 | /* c8 ignore next 7 */ |
| 43 | // eslint-disable-next-line no-console |
| 44 | console.warn( |
| 45 | name + |
| 46 | ': 里面 postcss.plugin 被弃用. 迁移指南:\n' + |
| 47 | 'https://www.w3ctech.com/topic/2226' |
| 48 | ) |
| 49 | } |
| 50 | } |
| 51 | let transformer = initializer(...args) |
| 52 | transformer.postcssPlugin = name |
| 53 | transformer.postcssVersion = new Processor().version |
| 54 | return transformer |
| 55 | } |
| 56 | |
| 57 | let cache |
| 58 | Object.defineProperty(creator, 'postcss', { |
no test coverage detected
searching dependent graphs…