1
- var project = 'nvQuickTheme' , // If using dev environment in live instance, this needs to be the same as your root folder name.
2
- version = '1.0.0' ,
3
- author = 'TK Sheppard & David Poindexter' ,
4
- company = 'nvisionative' ,
5
- url = 'www.nvquicktheme.com' ,
6
- email = 'support@nvisionative.com' ,
7
- description = 'A DNN Theme Building Framework' ;
8
-
9
- var manifest = './manifest.json' ;
10
1
var gulp = require ( 'gulp' ) ,
11
2
autoprefixer = require ( 'gulp-autoprefixer' ) ,
12
3
jshint = require ( 'gulp-jshint' ) ,
@@ -20,23 +11,38 @@ var gulp = require('gulp'),
20
11
zip = require ( 'gulp-zip' ) ,
21
12
clean = require ( 'gulp-clean' ) ,
22
13
path = require ( 'path' ) ,
23
- config = require ( manifest ) ,
14
+ details = require ( './project-details.json' ) ,
15
+ project = details . project ,
16
+ version = details . version ,
17
+ author = details . author ,
18
+ company = details . company ,
19
+ url = details . url ,
20
+ email = details . email ,
21
+ description = details . description ,
22
+ config = require ( './pathing.json' ) ,
24
23
node = ( config . node . length ) ? config . node + '/' : '' ,
25
24
assets = ( config . assets . length ) ? config . assets + '/' : '' ,
26
25
src = ( config . src . length ) ? config . src + '/' : '' ,
27
26
dist = ( config . dist . length ) ? config . dist + '/' : '' ,
28
27
temp = ( config . temp . length ) ? config . temp + '/' : '' ,
29
- build = ( config . build . length ) ? config . build + '/' : '' ;
28
+ build = ( config . build . length ) ? config . build + '/' : '' ;
29
+
30
+
30
31
31
32
/*
32
33
* IMAGE/SVG TASKS
33
34
------------------------------------------------------*/
34
35
35
36
// Compresses images for production.
36
37
gulp . task ( 'images' , function ( ) {
37
- return gulp . src ( './' + src + 'images/**/*.{jpg,jpeg,png,gif}' )
38
- . pipe ( imagemin ( ) )
39
- . pipe ( gulp . dest ( './' + dist + 'images/' ) ) ;
38
+ return gulp . src ( './images/**/*.{jpg,jpeg,png,gif}' )
39
+ . pipe ( imagemin ( {
40
+ interlaced : true ,
41
+ progressive : true ,
42
+ optimizationLevel : 5 ,
43
+ svgoPlugins : [ { removeViewBox : true } ]
44
+ } ) )
45
+ . pipe ( gulp . dest ( './dist/images/' ) ) ;
40
46
} ) ;
41
47
42
48
@@ -56,15 +62,15 @@ gulp.task('scss', function() {
56
62
. pipe ( notify ( { message : 'Styles compiled successfully!' , title : 'sass' , sound : false } ) ) ;
57
63
} ) ;
58
64
59
- // Dev Bootstrap creation.
65
+ // Development Bootstrap creation.
60
66
// Checks for errors and concats. Minifies. All Bootstrap CSS
61
67
gulp . task ( 'bscss' , function ( ) {
62
68
return gulp . src ( './' + src + assets + 'bootstrap/scss/**/*.scss' )
63
69
. pipe ( sass ( { outputStyle : 'compressed' } ) . on ( 'error' , sass . logError ) )
64
70
. pipe ( rename ( { suffix : '.min' } ) )
65
71
. pipe ( autoprefixer ( { browsers : [ 'last 2 versions' , 'ie >= 9' , '> 1%' ] } ) )
66
- . pipe ( gulp . dest ( './' + dist + '/ css/' ) )
67
- . pipe ( notify ( { message : 'Styles compiled successfully!' , title : 'sass ' , sound : false } ) ) ;
72
+ . pipe ( gulp . dest ( './' + dist + 'css/' ) )
73
+ . pipe ( notify ( { message : 'Styles compiled successfully!' , title : 'bootstrap ' , sound : false } ) ) ;
68
74
} )
69
75
70
76
@@ -87,7 +93,6 @@ gulp.task('js', function() {
87
93
return { message : 'JS much excellent success!' ,
88
94
title : file . relative ,
89
95
sound : false ,
90
- icon : path . join ( 'node_modules/gulp-notify/node' , 'gulp.png' ) ,
91
96
} ;
92
97
}
93
98
var errors = file . jshint . results . map ( function ( data ) {
@@ -96,9 +101,8 @@ gulp.task('js', function() {
96
101
}
97
102
} ) . join ( "\n" ) ;
98
103
return { message : file . relative + " (" + file . jshint . results . length + " errors)\n" + errors ,
99
- sound : "Frog" ,
104
+ sound : false ,
100
105
emitError : true ,
101
- icon : path . join ( 'node_modules/gulp-notify/node' , 'gulp-error.png' ) ,
102
106
title : 'JSLint'
103
107
} ;
104
108
} ) )
@@ -112,7 +116,7 @@ gulp.task('js', function() {
112
116
113
117
gulp . task ( 'containers' , function ( ) {
114
118
gulp . src ( './containers/*' )
115
- . pipe ( gulp . dest ( '../../Containers/' + project + '/' ) )
119
+ . pipe ( gulp . dest ( '../../Containers/' + project + '/' ) )
116
120
. pipe ( notify ( { message : 'Containers updated!' , title : 'containers' , sound : false } ) ) ;
117
121
} ) ;
118
122
@@ -147,9 +151,9 @@ gulp.task('init', function() {
147
151
148
152
} ) ;
149
153
150
- // Takes the information provided at the top of this file and populates it into the dnn- manifest file.
154
+ // Takes the information provided at the top of this file and populates it into the manifest.dnn file.
151
155
gulp . task ( 'manifest' , function ( ) {
152
- gulp . src ( './dnn- manifest.dnn' )
156
+ gulp . src ( './manifest.dnn' )
153
157
. pipe ( replace ( / \< p a c k a g e n a m e \= \" ( .* ?) (? = \" ) / , '<package name="' + company + '.' + project ) )
154
158
. pipe ( replace ( / t y p e \= \" S k i n \" v e r s i o n \= \" ( .* ?) (? = \" ) / , 'type="Skin" version="' + version ) )
155
159
. pipe ( replace ( / \< f r i e n d l y N a m e \> ( .* ?) (? = \< ) / , '<friendlyName>' + project ) )
@@ -187,7 +191,7 @@ gulp.task('zipcontainers', function() {
187
191
188
192
// Zips everything else
189
193
gulp . task ( 'zipelse' , function ( ) {
190
- return gulp . src ( [ './menus/**/*' , './partials/*' , '*.ascx' , '*. xml' , '*. html' , '*. htm'] , { base : '.' } )
194
+ return gulp . src ( [ './menus/**/*' , './partials/*' , '*.{ ascx, xml, html, htm} ' ] , { base : '.' } )
191
195
. pipe ( gulp . dest ( './' + temp ) )
192
196
. pipe ( replace ( 'dist/' , '' ) )
193
197
. pipe ( zip ( 'else.zip' ) )
@@ -225,6 +229,7 @@ gulp.task('watch', function () {
225
229
gulp . watch ( src + assets + "bootstrap/scss/**/*.scss" , [ 'bscss' ] )
226
230
gulp . watch ( [ src + "js/**/*.js" ] , [ 'js' ] )
227
231
gulp . watch ( './containers/*' , [ 'containers' ] )
232
+ gulp . watch ( './project-details.json' , [ 'manifest' ] )
228
233
} ) ;
229
234
230
235
// gulp build
0 commit comments