simplr-gulp
v2.8.4
Published
Fully functional gulpfile.js implementation. Tailored for Single Page Application. Written in TypeScript.
Downloads
215
Readme
simplr-gulp
I just want to use gulpfile.js
- Install
simplr-gulp
in your project:
npm install simplr-gulp --save-dev
- Create
gulpfile.js
in your project root directory:
require('simplr-gulp');
- Start command:
gulp -T
Which will show all available commands.
All directories, server and live-reload settings are configured in gulpconfig.json
.
After first run, gulpconfig.json
file will be generated for you to edit for your own use.
Requirements
- NodeJS:
>= 6.0.0
- Typescript:
^1.8.10 || ^2.0.0
Available commands
Gulp tasks
default
- startWatch
task with server.Build
- compiles source files with development environment (starts allBuild.*
subtasks)Build.Assets
- copies allassets
folders and their contents from source to build directoryBuild.Configs
- copiesconfigs
folder from source to build directory with jspm environmentBuild.Configs.Files
- copyjspm.config.js
file from source to build directory with production environment (production only)Build.Configs.Folders
- copies configs folder from source to build directory
Build.Html
- copies all*.html
files from source to build directoryBuild.Scripts
- compiles TypeScript with sourcemap from source to build directoryBuild.Scripts.Typescript
- compiles TypeScript with sourcemap from source to build directoryBuild.Scripts.Tslint
- check for tslint warnings
Build.Styles
- compiles*.scss
files from source to build directory
Build:Production
- compiles, minifies and uglifies source files with production environment (starts allBuild.*:Production
subtasks)Build.Assets:Production
- copies allassets
folders and their contents from source to build directoryBuild.Configs:Production
- copiesweb.config
(for Asp.Net 5 projects) andconfigs
folder from source to build directoryBuild.Html:Production
- copies all*.html
files from source to build directoryBuild.Scripts:Production
- compiles TypeScript from source to build directoryBuild.Scripts.Typescript:Production
- compiles TypeScript from source to build directoryBuild.Scripts.Tslint:Production
- check for tslint warnings
Build.Styles:Production
- compiles and minifies*.scss
files from source to build directory
Watch
- watch source files, start tasks (allWatch.*
subtasks) and call live reload action.Watch.Assets
- start taskBuild.Assets
Watch.Configs
- start taskBuild.Configs
Watch.Html
- start taskBuild.Html
Watch.Scripts
- start taskBuild.Script
Watch.Styles
- start taskBuild.Styles
Watch.*
subtasks available only at runtime.
Bundle
- bundles the app withjspm bundle
with development environmentJspm.CdnPaths:Production
- Generate CDN paths (https://cdnjs.com) into src/configs/jspm.config.production.js using npm registryClean
- cleans build directory (wwwroot
by default) withoutwwwroot/libs
folder andwwwroot/**/.gitkeep
filesClean.All
- cleans build directory (wwwroot
by default) withoutwwwroot/**/.gitkeep
filesClean.Bundle
- remove build file (build.js
by default) from build directory (wwwroot
by default)Clean.Libs
- cleans libs directory (wwwroot/libs
by default)
Trying it yourself
git clone https://github.com/QuatroCode/simplr-gulp.git
cd simplr-gulp/example
npm install
jspm install
gulp
- Go to http://localhost:4000
Default gulpconfig.json
(can be customized)
{
"Directories": {
"Source": "src",
"Build": "wwwroot",
"App": "app"
},
"TypeScriptConfig": {
"Development": "tsconfig.json",
"Production": "tsconfig.production.json"
},
"ServerConfig": {
"Ip": "127.0.0.1",
"Port": 4000,
"LiveReloadPort": 4400
},
"BundleConfig": {
"AppFile": "app.js",
"BuildFile": "build.js",
"Include": [],
"Exclude": [
"[app/**/*]"
]
},
"WebConfig": null,
"CfgVersion": 2.02
}
Development
Prerequisites
You need global npm packages (gulp
, typings
, jspm
):
npm install gulp-cli -g
npm install typings -g
npm install jspm -g
If you want to update simplr-gulp
package yourself
git clone https://github.com/QuatroCode/simplr-gulp.git
cd simplr-gulp
npm install
typings install
builder.bat -watch:sample
- Make changes
Build project
tsc -p .