This package adds support for pegjs in parcel.
From the command line:
npm install --save-dev parcel-bundler pegjs@dev parcel-plugin-pegjs
In your code:
import parser from "./path/to/parser.pegjs";
Or...
const parser = require("./path/to/parser.pegjs");