Apostrophe Browserify
This Apostrophe 2 module enables you to bundle your frontend code using browserify
while taking advantage of automatic minification and Apostrophe's asset pipeline.
When using the development
option watchify
will run, recompiling your assets any time they are saved.
To use it, run npm install apostrophe-browserify --save
and add it to your app.js
configuration:
{
...
'apostrophe-browserify': {
files: [ './public/js/modules/_site.js' ]
}
...
}
Configuration
Apostrophe will save your bundled file to the public/js/
directory. By default it creates _site-compiled.js
, however the filename can be configured using the outputFile
option.
{
'apostrophe-browserify': {
files: [ './public/js/modules/_site.js' ],
outputFile: '_site-compiled.js',
development: false,
verbose: true,
basedir: __dirname + '/public/js',
browserifyOptions: {
}
}
}