README
portable.js
portable.js
bundles your node.js and browser apps into a single or multiple .js
files.
Don't reinvent the wheel! portable.js
gives you exactly the same require
function as node.js.
Getting started
TLDR: You create a manifest file portable.js
then run portable.js bundle
command in your terminal and your .js
app is ready.
Read this introduction tutorial if you are using portable.js
for the first time.
Manifest
portable.js
needs a manifest file that defines how to bundle your project. The default name of the manifest file is
poartable.js
. You can overwrite it with the --file
command line option:
portable.js --file ./some-other-file.json
The manifest file can be either .js
or .json
file. In case it is .js
it should export an object using
module.exports
syntax. If --file
is not specifies portable.js
, portable.config.js
, portable.json
, and
portable.config.json
will be tried in that order.
A typical portable.js
manifest could look like this:
module.exports = {
dest: './build', // Folder where results are saved.
layer: { // Layer to build.
"layer-name": { // Layer name.
src: './src', // Folder where to look for files.
glob: [ // Globs to use to match files.
'*.js',
'**/*.md'
],
transform: [ // Transforms to apply to files matched by regex.
['.*\.js