Neurophysiologically Pseudoscientific Manatee
Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »

pegjs-brunch

1.0.1 • Public • Published

pegjs-brunch

Copyright 2017, Caleb Evans
Released under the MIT License

Build Status

This plugin adds PEG.js support to Brunch.

Usage

1. Install the package

In your project directory, run:

npm install --save-dev pegjs-brunch

2. Set plugin options

In brunch-config.js, you can specify any options which should be passed to the parser generator. See the PEG.js API reference for a list of available options.

module.exports = {
  // ...
  plugins: {
    pegjs: {
      cache: true,
      format: 'commonjs'
    }
  }
  // ...
};

3. Watch grammar files

Because the plugin will generate JavaScript files from any *.pegjs grammar files, you must tell Brunch to watch *.pegjs files.

In brunch-config.js, add a *.pegjs pattern somewhere in the javascripts.joinTo map.

module.exports = {
  // ...
  javascripts: {
    joinTo: {
      'main.js': ['app/scripts/*.pegjs', 'app/scripts/*.js', /^node_modules/]
    }
  }
  // ...
};

Keywords

install

npm i pegjs-brunch

Downloadsweekly downloads

0

version

1.0.1

license

MIT

repository

githubgithub

last publish

collaborators

  • avatar