@touchtribe/frontend-scripts

1.0.2 • Public • Published

Installation

Adding the package

npm install @touchtribe/frontend-scripts

Adding the CLI commands

In package.json:

{
  ...,
  "scripts": {
    "build": "frontend-scripts build",
    "watch": "frontend-scripts watch",
    "release": "frontend-scripts release",
  },
  ...
}

Adding tasks

frontend-scripts reads tasks out of the package.json file:

{
  ...,
  "frontend": {
    "sourcePath": "./src",
    "buildPath": "./dist",
    "tasks": []
  },
  ...
}

Environment specific tasks

To have environment specific build tasks, add them according to the index frontend.<environment>:

{
  ...,
  "frontend": {
    "sourcePath": "./src"
  },
  "frontend.development": {
    "buildPath": "./dist",
    "tasks": []
  },
  "frontend.production": {
    "buildPath": "./release",
    "tasks": []
  },
  ...
}

The resulting configuration is a merge of:

  • Base task config
  • frontend
  • frontend.environment (if it exists)

Tasks

Tasks get added using the following signature:

// taskname: string
// config: configuration object, will deep-merge the base config
[<taskname>, <config>]

Environment-specific tasks do not merge with global tasks but are added as separate tasks.

Task configuration

Todo

  • [x] Publish on NPM ;-)
  • [ ] Migrate documentation
  • [ ] Complete documentation
  • [ ] Rewrite task runner to single process
  • [ ] Move tasks to seperate modules

Readme

Keywords

none

Package Sidebar

Install

npm i @touchtribe/frontend-scripts

Weekly Downloads

51

Version

1.0.2

License

ISC

Unpacked Size

35 kB

Total Files

27

Last publish

Collaborators

  • doxick
  • mnjongerius