Skip to main content

XEpack (Tool)

What it does

Tool for building and deploying xeditor packages.

Installation

The tool can be installed globally to use it within the command line.

# npm install --global @xeditor/tool-xepack --registry https://npm.xeditor.com:4873

The tool can be also be used inside the packages using the scripts. Therefor you can add it as an devDependency:

$ npm install --save-dev @xeditor/tool-xepack --registry https://npm.xeditor.com:4873

Usage

xepack 1.5.0

Usage: xepack [args]

Config options:
--config, -cPath to the config file[string]
Basic options:
--watch, -wWatch the filesystem for changes[boolean]
--production, -pPredefined switch for production.[boolean]
--develop, -dPredefined switch for develop.[boolean]
--cleanCleans the project[boolean]
--quiet, -qPrevents output[boolean]
Advanced options:
--source-mapEnables the soure map for this project[boolean]
--closure-compilerEnables the closure compiler[boolean]
--uglifyEnables the uglification.[boolean]
Developer options:
--serve, -SServes the files for developing. You can also pass a port number to start it to an specific port, otherwise the port 7070 will be used.
--open, -OOpens the dev server in the default browser[boolean]
Options:
--help, -hShow help[boolean]
--version, -vShow version number[boolean]

Configuration

Xepack can be configured using an javascript file with exports the configuration using module.exports. It will use the given confiuration file (Using the --config argument) or searchs for an xepack.config.js file inside the execution directory.

module.exports = [{

/* Flags to enable/disable features */
flags: {
uglify: boolean, /* Enables/Disables the uglification/minimization*/
closure: boolean, /* Enables/Disables the Google Closure Compiler. Therefor Java is required! */
sourceMap: boolean, /* Enables/Disables the creation of Source Maps */
loader: boolean, /* Enables/Disables the creation of the `xeditor.loader.js` script */
clean: boolean, /* Enables/Disable the clean of the output directory */
deepCopy: boolean /* Enables/Disables the copying of all dependencies */
},

/* Entries to build */
entry: string | Object,

/* Output configuration. */
output: {
path: string, /* Output direcotry. Default: `./dist` */
filename: string /* Output filename. The varaible `[name]` can be used here i.e. `js/[name].js`. Default: `js/[name].js` and with `flags.uglify` it is `js/[name].min.js` */
} | string, /* Output direcotry. Default: `./dist` */

/* Configuration */
config: {

/* Configuration for environment variable within the source code */
env: Object,

/* Configuration for libraries */
library: {
name: string, /* Name of the library */
target: string /* Target of the library. Default: `this` */
} | string, /* Name of the library */

/* Configuration for deep copy */
deepCopy: {
ignore: string[], /* Files to ignore */
dependencies: string[] /* Dependencies to copy. Default: `package.json:dependencies` */
},

/* Configuration for the file loader - `xeditor.loader.js`*/
loader: {
ignore: string[], /* Files to ignore */
loadAfter: string[] /* Files to load after all other files. By default the entries will be loaded at asynchronous */
}
},

/* Array of all static files*/
statics: Array<{
from: string, /* Location of the static file/files */
to: string /* Location of the destination */
}> | string /* Location of the static files. Default: `./static` */
}];