Package Exports
- simplr-gulp
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (simplr-gulp) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
simplr-gulp
I just want to use gulpfile.js
- Install
simplr-gulpin your project:
npm install simplr-gulp --save-dev- Create
gulpfile.jsin your project root directory:
require('simplr-gulp');- Start command:
gulp -TWhich 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- startWatchtask with server.Build- compiles source files with development environment (starts allBuild.*subtasks)Build.Assets- copies allassetsfolders and their contents from source to build directoryBuild.Configs- copiesconfigsfolder from source to build directory with jspm environmentBuild.Configs.Files- copyjspm.config.jsfile 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*.htmlfiles 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*.scssfiles from source to build directory
Build:Production- compiles, minifies and uglifies source files with production environment (starts allBuild.*:Productionsubtasks)Build.Assets:Production- copies allassetsfolders and their contents from source to build directoryBuild.Configs:Production- copiesweb.config(for Asp.Net 5 projects) andconfigsfolder from source to build directoryBuild.Html:Production- copies all*.htmlfiles 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*.scssfiles from source to build directory
Watch- watch source files, start tasks (allWatch.*subtasks) and call live reload action.Watch.Assets- start taskBuild.AssetsWatch.Configs- start taskBuild.ConfigsWatch.Html- start taskBuild.HtmlWatch.Scripts- start taskBuild.ScriptWatch.Styles- start taskBuild.Styles
Watch.*subtasks available only at runtime.
Bundle- bundles the app withjspm bundlewith development environmentJspm.CdnPaths:Production- Generate CDN paths (https://cdnjs.com) into src/configs/jspm.config.production.js using npm registryClean- cleans build directory (wwwrootby default) withoutwwwroot/libsfolder andwwwroot/**/.gitkeepfilesClean.All- cleans build directory (wwwrootby default) withoutwwwroot/**/.gitkeepfilesClean.Bundle- remove build file (build.jsby default) from build directory (wwwrootby default)Clean.Libs- cleans libs directory (wwwroot/libsby default)
Trying it yourself
git clone https://github.com/QuatroCode/simplr-gulp.gitcd simplr-gulp/examplenpm installjspm installgulp- 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, rollup):
npm install gulp-cli -gnpm install typings -gnpm install jspm -gnpm install rollup -g
If you want to update simplr-gulp package yourself
git clone https://github.com/QuatroCode/simplr-gulp.gitcd simplr-gulpnpm installtypings installbuilder.bat -watch:sample- Make changes
builder.bat available commands
builder.bat -build # build code to /dist
builder.bat -build:sample # build code to /example
builder.bat -watch # build and start watcher to /dist
builder.bat -watch:sample # build and start watcher to /example