rollup-plugin-bpmnlint
Advanced tools
Comparing version 0.4.0 to 0.4.1
20
index.js
@@ -5,3 +5,21 @@ const requireLocal = createScopedRequire(process.cwd()); | ||
function requireCompiler() { | ||
let prefix = 'bpmnlint'; | ||
try { | ||
const pkg = requireLocal('./package.json'); | ||
// require bpmnlint locally if we operate within the project | ||
if (pkg && pkg.name === 'bpmnlint') { | ||
prefix = '.'; | ||
} | ||
} catch (err) { | ||
// ignore, this is expected | ||
} | ||
return requireLocal(`${prefix}/lib/support/compile-config`); | ||
} | ||
function bpmnlint(options = {}) { | ||
@@ -20,3 +38,3 @@ | ||
try { | ||
compileConfig = compileConfig || requireLocal('bpmnlint/lib/support/compile-config'); | ||
compileConfig = compileConfig || requireCompiler(); | ||
} catch (err) { | ||
@@ -23,0 +41,0 @@ throw new Error('cannot find local <bpmnlint>. Install it or provide a configuration compiler throught the <compileConfig> option.'); |
{ | ||
"name": "rollup-plugin-bpmnlint", | ||
"version": "0.4.0", | ||
"version": "0.4.1", | ||
"description": "Convert bpmnlint config files to consumable modules", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
5478
72