pacmod is a package module environment that can be used to develop browser modules with es6. Using babel and browserify, pacmod will compile your packages into a single distribution file.
Warning: Please note that releases before 1.0.0 may not be backwards compatable
Simply install the cli
npm install -g pacmod
And you can get started!
Packages are defined as self contained components or module packs that are distributed with their own unit tests. Each package should be independant and have no dependencies outside of itself. The package folder structure is
- /package-name----- /index.js (entry point)
Assuming your project is organized in package-module structure you can get started by simply running
In the project directory. pacmod will look for a
packages folder and compile all packages present. You should always define a main entry point that will be invoked once the file is loaded (defaults to the main.js package)
pacmod will also copy files in the public folder of your project to the dist folder. Once complete, pacmod will open your projects dev environment in your default browser. pacmod will continue watching your files for changes and reloading them in the browser.
To configure pacmod, create a pacmod.json file in your project directory. The following configuration options are available:
The directory to use for temporary build files. You should have this directory in your project's
'pacmod' if not available)
The name of your module and the subsequent file to be built
The folder to to build the application to
The folder relative to the
BUILD_TARGET that the compiled JS file should be moved to
The name of the package that should be used as the main entry point for the application. This file will be invoked on script load.
The port to serve development files from.
The port to serve test files from
pacmod has QUnit support built in! You can write all of your tests in the
/tests folder of the respective package. To run your tests, run
from your project directory. Your tests will be built and a window will open in your default browser to run the tests. You can even run
pacmod test simultaneously while developing.