-
Notifications
You must be signed in to change notification settings - Fork 0
/
sample-gulpfile.js
157 lines (131 loc) · 6.39 KB
/
sample-gulpfile.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
// this sample config file shows all options of gulp-modular
// * uncomment tasks to activate them
// * uncomment configuration options to override defaults
var gulp = require('gulp');
var gulpModular = require('gulp-modular');
var config = {
/***** General *****/
//// task `build` executes the following tasks (if activated): `index`, `images`, `statics`
build: {
// dest: 'dist/', // point to the distribution folder
// bowerjson: 'bower.json', // path to the bower.json file
// babel: false, // uses babel to transpile ES6/ES2015 to ES5
// uglify: true, // minifies and compresses generated files
// rev: false, // append random revision postfixes to generated files
// bowerDebug: false, // prints gulp pipes from included bower files
// sourceMapPath: '.', // default (relative) path to place sourcemaps
// index: 'app/index.html', // defines the root html file
// transformJS: function (filepath) { // transform filename of JS files
// return '<script src="' + filepath + '?' + version + '"></script>';
// },
// transformCSS: function (filepath) { // transform filename of CSS files
// return '<link rel="stylesheet" href="' + filepath + '?' + version + '">';
//}
},
//// task `preprocess` automatically injects variables into your files
preprocess: {
// apply: {
// index: true,
// html: false,
// scripts: false,
// styles: false
// },
// context: {
// APP: 'app', // angular app name (can be used using <!-- @echo APP -->)
// BASE: '/' // base tag for html5mode
// }
},
//// task [`clean`] provides removal of build artifacts
//clean: {
// dest: 'dist/' // glob pointing to all build artifacts
//},
/***** Management and Processing of Dependencies *****/
//// [`bower`] registers tasks `bower:install` and `bower:prune` for package management by bower
//bower: null,
//// task [`bowerFonts`] collects fonts from bower dependencies and stores them in a dedicated distribution folder
//bowerFonts: {
// dest: 'dist/fonts/' // destination of the font files
//},
//// task [`bowerScripts`] collects scripts from bower dependencies stores them in a dedicated distribution folder
//bowerScripts: {
// dest: 'dist/js/' // destination of the concat file `vendor.js` (and associated sourcemaps file)
//},
//// task [`bowerStyles`] collects styles from bower dependencies and stores them in a dedicated distribution folder
//bowerStyles: {
// dest: 'dist/css/' // destination of the concat file `vendor.css` (and associated sourcemaps file)
//},
/***** Processing of User Space *****/
//// task [`statics`] collects all "static" files and stores them in a dedicated distribution folder
//statics: {
// src: ['app/.htaccess', 'app/favicon.ico', 'app/robots.txt'], // glob that points to all static files
// dest: 'dist/' // destination of the static files
//},
//// task [`images`] collects, flattens and minifies graphics
//images: {
// src: 'app/components/**/*.{png,jpg,jpeg,gif,svg,ico}', // glob that points to all images
// dest: 'dist/images/' // destination of the image files
//},
//// task [`fonts`] collects fonts and stores them in a dedicated distribution folder
//fonts: {
// src: 'app/fonts/**/*.{otf,eot,svg,ttf,woff,woff2}', // glob that points to all fonts
// dest: 'dist/fonts/' // destination of the font files
//},
//// task [`scripts`] collects scripts, runs several transformations and concatenates everything
//scripts: {
// src: ['app/components/**/*.js', '!app/components/**/*.spec.js'], // glob that points to all scripts (except tests)
// dest: 'dist/js/', // destination of the concat file `scripts.js` (and associated sourcemaps file)
// ng2html: { // adds ng2html and saves all html partials right into the AngularJS $templateCache
// src: 'app/components/**/*.html', // glob that points to all partials
// prefix: 'components/', // prefix of the URL path
// flatten: false, // remove the URL path
// name: 'app.templates' // the module name that contains the partials
// },
// ngConstant: { // adds ngConstant to dynamically add variables to your AngularJS app
// constants: {}, // the object that contains the variables
// name: 'app.config' // the module name that contains the variables
// }
//},
//// task [`styles`] collects styles (.scss), runs several transformations and concatenates everything
//styles: {
// src: 'app/style.scss', // root SCSS file (imports are inside)
// files: 'app/**/*.scss', // all SCSS files that have to be watched for changes
// dest: 'dist/css/' // destination of the concat file `style.css` (and associated sourcemaps file)
// prefixer: { // all autoprefixer options (https://github.com/postcss/autoprefixer#options) can be set here
// browsers: ['last 2 versions'], // list of browsers, which are supported in your project
// cascade: false // should autoprefixer use visual cascade
// }
//},
/***** Serving *****/
//// [`serve`] registers tasks `browserSync` to serve the app and `watch` to reload the app on detected file changes
//serve: {
// root: 'dist/', // the root of the local server
// port: 3000, // the port of the local server
// proxy: undefined, // host of locally served app that should be proxied to allow livereload
// watch: true // deactivates watches and automatic browser reloading
//},
/***** Deployment *****/
//// task [`gitDeploy`] deploys to a specific branch in your git repository
//gitDeploy: {
// src: 'dist/', // the local root of the deploy repo
// branch: undefined // specifies git repository branch to deploy to
//},
//// task [`mavenInstall`] allows to install maven packages locally
//mavenInstall: {
// src: '.', // root of the maven package
// config: {} // the maven package config
//},
//// task [`mavenDeploy`] allows to add maven packages to a remote server
//mavenDeploy: {
// src: '.', // root of the maven package
// config: {}, // the maven package config
// repo: {} // the remove maven package repository
//},
/***** Testing *****/
//// task [`jshint`] lints code with respect to your `.jshintrc` files
//jshint: {
// src: 'app/components/**/*.js' // glob specifying what to lint
// reporter: '' // additional reporter e.g. to fail on warnings
//},
};
// start gulp modular and pass in config
gulpModular(gulp, config);