MCPcopy
hub / github.com/postcss/postcss / creator

Function creator

lib/postcss.js:31–55  ·  view source on GitHub ↗
(...args)

Source from the content-addressed store, hash-verified

29postcss.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', {

Callers 2

getFunction · 0.85
postcss.jsFile · 0.85

Calls 1

warnMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…