bpmnlint-loader
raw JSON → 0.1.6 verified Sat Apr 25 auth: no javascript
Webpack loader that enables bundling bpmnlint configuration files (.bpmnlintrc) for use in browser builds. Requires bpmnlint as a peer dependency. Version 0.1.6 is the latest stable release, maintained by the bpmn-io organization. It seamlessly integrates with webpack to resolve and transpile config files, allowing linter instantiation in webpack bundles. Differentiators: simplifies client-side BPMN linting by leveraging webpack's module system.
Common errors
error Module parse failed: Unexpected token (1:0) You may need an appropriate loader to handle this file type. ↓
cause Webpack does not recognize .bpmnlintrc files without the loader configured.
fix
Add the loader rule as shown in the quickstart.
Warnings
gotcha Loader only works with bpmnlint config files that are valid JSON or JS export. Ensure the .bpmnlintrc file is parsable by bpmnlint. ↓
fix Validate your .bpmnlintrc content against bpmnlint schema.
gotcha bpmnlint-loader does not validate the config; it only exports the parsed module. Errors in config will surface at runtime in bpmnlint. ↓
fix Use bpmnlint's own validation or test configs separately.
Install
npm install bpmnlint-loader yarn add bpmnlint-loader pnpm add bpmnlint-loader Imports
- default (loader) wrong
import bpmnlintLoader from 'bpmnlint-loader'; // Loader is not exported, only used in webpack configcorrectmodule.exports = { module: { rules: [ { test: /\.bpmnlintrc$/, use: ['bpmnlint-loader'] } ] } }
Quickstart
// webpack.config.js
module.exports = {
module: {
rules: [
{
test: /\.bpmnlintrc$/,
use: ['bpmnlint-loader']
}
]
}
};
// Your source code
import { Linter } from 'bpmnlint';
import linterConfig from './.bpmnlintrc';
const linter = new Linter(linterConfig);