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

Function loadModule

src/utils/load-module.js:3–13  ·  view source on GitHub ↗
(moduleId)

Source from the content-addressed store, hash-verified

1import importCwd from 'import-cwd'
2
3export function loadModule(moduleId) {
4 // Trying to load module normally (relative to plugin directory)
5 try {
6 return require(moduleId)
7 } catch {
8 // Ignore error
9 }
10
11 // Then, trying to load it relative to CWD
12 return importCwd.silent(moduleId)
13}

Callers 3

loadSassOrThrowFunction · 0.90
processFunction · 0.90
processFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…