@technologyadvice/genesis-core
v0.15.5
Published
Simplified build tooling for a complected world
Downloads
97
Readme
Take advantage of the modern JavaScript ecosystem without any of the headache. Genesis Core provides a consistent, simplified interface over powerful build tooling. Configure it once and get to work; you'll enjoy the same experience whether you're building a Single Page Application or distributable NPM package.
Table of Contents
Installation
It's recommended to install Genesis Core as a project-level dependency, and not a global depdendency. This will give you the freedom to run multiple projects independently and will provide more fine-grained control over upgrades.
# Yarn (recommended)
yarn add --dev @technologyadvice/genesis-core
# NPM
npm install --save-dev @technologyadvice/genesis-core
Targets
Web App
This compiler is still in progress.
NPM Package
This compiler is still in progress.
Usage
Genesis is configured with the same options no matter which API is used.
Configuration
{
entry : string | Array<string>, // path(s) to your application entry point(s)
templatePath : string, // path to your main index.html file
vendors : Array<string>, // package names to bundle separately
alias : { [key: string]: string }, // module resolution aliases
globals : { [key: string]: any }, // variables to expose globally
sourcemaps : boolean, // generate sourcemaps?
verbose : boolean, // enable more verbose output?
transpile : boolean | 'typescript', // transpile? `true` defaults to babel
}
Command Line Interface
After installing Genesis Core in your project, you can use the gen
binary to run tasks. To do this, configure your package.json
scripts to run gen
commands.
{
"scripts": {
"start": "gen start",
"build": "gen build",
"test": "gen test"
}
}
Once this is done, you can run these just like any other npm command. Note that you can also pass options to the genesis task:
npm start -- --port 3000
Node API
const genesis = require('@technologyadvice/genesis-core')
const compiler = genesis({
// your genesis configuration
})
// Each task returns a promise:
compiler.build()
.then(() => { /* app has been built! */ })
// You can pass task-specific option:
compiler.start({ host: 'localhost', port: 3000 })
compiler.test({ watch: true })