@touchtribe/frontend-scripts
v1.0.2
Published
Frontend build scripts to make your life easier
Downloads
60
Readme
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
- javascript
- css
- copy
- handlebars
- browsersync
- images
- icons
Todo
- [x] Publish on NPM ;-)
- [ ] Migrate documentation
- [ ] Complete documentation
- [ ] Rewrite task runner to single process
- [ ] Move tasks to seperate modules