MCPcopy Create free account
hub / github.com/egoist/rollup-plugin-postcss / process

Function process

src/less-loader.js:9–34  ·  view source on GitHub ↗
({ code })

Source from the content-addressed store, hash-verified

7 name: 'less',
8 test: /\.less$/,
9 async process({ code }) {
10 const less = loadModule('less')
11 if (!less) {
12 throw new Error('You need to install "less" packages in order to process Less files')
13 }
14
15 let { css, map, imports } = await pify(less.render.bind(less))(code, {
16 ...this.options,
17 sourceMap: this.sourceMap && {},
18 filename: this.id
19 })
20
21 for (const dep of imports) {
22 this.dependencies.add(dep)
23 }
24
25 if (map) {
26 map = JSON.parse(map)
27 map.sources = map.sources.map(source => humanlizePath(source))
28 }
29
30 return {
31 code: css,
32 map
33 }
34 }
35}

Callers

nothing calls this directly

Calls 2

loadModuleFunction · 0.90
humanlizePathFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…