3. Gulp configuration - MattAndDev/gulp-boilerplate GitHub Wiki
All paths and plugin settings have been abstracted into a centralized config object in gulp/config.js. Adapt the paths and settings to the structure and needs of your project.
Here is a list of all the config sections and their coupled tasks
Dest and Src
represent the main source and distribution paths globally.
var dest = "./dist";
var src = './src';
Browserify
task browserify.js
TBD
Browser-sync
task browserSync.js
Object passed as browser-sync options.
Refer to the original browser-sync docs for further informations.
// ==============================
// browserSync.js settings
// ==============================
browserSync: {
port: 9000,
server: {
// Serve up our build folder
baseDir: dest
},
notify: false,
open: false
},
Images
task images.js
Object containing images src/dest directory and gulp-imagemin settings .
// ==============================
// images.js settings
// ==============================
images: {
src: src + "/images/**",
dest: dest + "/images",
// gulp-imagemin settings
settings: {
}
},
Jslint
task jslint.js
TBD
Markup
task markup.js
Object containing markup src/dest directory and gulp-file-include settings .
// ==============================
// markup.js settings
// ==============================
markup: {
src: src + "/html/templates/*.tpl.html",
dest: dest + "/",
// gulp-file-include settings
settings: {
basepath: src + '/html/includes/',
prefix : '@@'
}
},
Production
task _production.js
TBD
Sass
task sass.js
Object containing sass src/dest directory, gulp-autoprefixer and gulp-sass settings .
// ==============================
// sass.js settings
// ==============================
sass: {
src: src + "/sass/**/*.{sass,scss}",
dest: dest + '/css',
// gulp-autoprefixer settings
prefix: [
'ie >= 9',
'ie_mob >= 10',
'ff >= 30',
'chrome >= 34',
'safari >= 7',
'opera >= 23',
'ios >= 7',
'android >= 4.4',
'bb >= 10'
],
// gulp-sass-settings
settings: {
indentedSyntax: true, // Enable .sass syntax!
imagePath: 'images' // Used by the image-url helper
}
},
Svgsprite
task sprite.js
TBD