You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Sep 3, 2024. It is now read-only.
varproject='voidx'// The directory name for your theme; change this at the very least!
5
-
,src='./src/'// The raw material of your theme: custom scripts, SCSS source files, PHP files, images, etc.; do not delete this folder!
6
-
,build='./build/'// A temporary directory containing a development version of your theme; delete it anytime
7
-
,dist='./dist/'+project+'/'// The distribution package that you'll be uploading to your server; delete it anytime
8
-
,assets='./assets/'// A staging area for assets that require processing before landing in the source folder (example: icons before being added to a sprite sheet)
9
-
,bower='./bower_components/'// Bower packages
10
-
,composer='./vendor/'// Composer packages
11
-
,modules='./node_modules/'// npm packages
12
-
;
4
+
varproject='voidx',// The directory name for your theme; change this at the very least!
5
+
src='./src/',// The raw material of your theme: custom scripts, SCSS source files, PHP files, images, etc.; do not delete this folder!
6
+
build='./build/',// A temporary directory containing a development version of your theme; delete it anytime
7
+
dist='./dist/'+project+'/',// The distribution package that you'll be uploading to your server; delete it anytime
8
+
assets='./assets/',// A staging area for assets that require processing before landing in the source folder (example: icons before being added to a sprite sheet)
,notify: false// In-line notifications (the blocks of text saying whether you are connected to the BrowserSync server or not)
20
-
,open: true// Set to false if you don't like the browser window opening automatically
21
-
,port: 3000// Port number for the live version of the site; default: 3000
22
-
,proxy: 'localhost:8080'// We need to use a proxy instead of the built-in server because WordPress has to do some server-side rendering for the theme to work
notify: false,// In-line notifications (the blocks of text saying whether you are connected to the BrowserSync server or not)
19
+
open: true,// Set to false if you don't like the browser window opening automatically
20
+
port: 3000,// Port number for the live version of the site; default: 3000
21
+
proxy: 'localhost:8080',// We need to use a proxy instead of the built-in server because WordPress has to do some server-side rendering for the theme to work
22
+
watchOptions: {
24
23
debounceDelay: 2000// This introduces a small delay when watching for file change events to avoid triggering too many reloads
25
24
}
26
25
},
27
26
28
27
images: {
29
28
build: {// Copies images from `src` to `build`; does not optimize
30
-
src: src+'**/*(*.png|*.jpg|*.jpeg|*.gif|*.svg)'
31
-
,dest: build
32
-
}
33
-
,dist: {
34
-
src: [dist+'**/*(*.png|*.jpg|*.jpeg|*.gif|*.svg)','!'+dist+'screenshot.png']// The source is actually `dist` since we are minifying images in place
35
-
,imagemin: {
36
-
optimizationLevel: 7
37
-
,progressive: true
38
-
,interlaced: true
39
-
}
40
-
,dest: dist
29
+
src: src+'**/*(*.png|*.jpg|*.jpeg|*.gif|*.svg)',
30
+
dest: build
31
+
},
32
+
dist: {
33
+
src: [dist+'**/*(*.png|*.jpg|*.jpeg|*.gif|*.svg)','!'+dist+'screenshot.png'],// The source is actually `dist` since we are minifying images in place
34
+
imagemin: {
35
+
optimizationLevel: 7,
36
+
progressive: true,
37
+
interlaced: true
38
+
},
39
+
dest: dist
41
40
}
42
41
},
43
42
@@ -47,102 +46,109 @@ module.exports = {
47
46
48
47
scripts: {
49
48
bundles: {// Bundles are defined by a name and an array of chunks (below) to concatenate; warning: this method offers no dependency management!
50
-
footer: ['footer']
51
-
,header: ['header']
52
-
,pageloader: ['pageloader','footer']
53
-
}
54
-
,chunks: {// Chunks are arrays of paths or globs matching a set of source files; this way you can organize a bunch of scripts that go together into pieces that can then be bundled (above)
49
+
footer: ['footer'],
50
+
header: ['header'],
51
+
pageloader: ['pageloader','footer']
52
+
},
53
+
chunks: {// Chunks are arrays of paths or globs matching a set of source files; this way you can organize a bunch of scripts that go together into pieces that can then be bundled (above)
55
54
// The core footer chunk is loaded no matter what; put essential scripts that you want loaded by your theme in here
56
55
footer: [
57
-
modules+'timeago/jquery.timeago.js'// The modules directory contains packages downloaded via npm
58
-
,src+'js/responsive-menu.js'
59
-
,src+'js/footer.js'
60
-
]
61
-
,header: [
62
-
modules+'svg4everybody/dist/svg4everybody.js'
63
-
,src+'js/header.js'
64
-
]
56
+
modules+'timeago/jquery.timeago.js',// The modules directory contains packages downloaded via npm
57
+
src+'js/responsive-menu.js',
58
+
src+'js/footer.js'
59
+
],
60
+
header: [
61
+
modules+'svg4everybody/dist/svg4everybody.js',
62
+
src+'js/header.js'
63
+
],
65
64
// The pageloader chunk provides an example of how you would add a user-configurable feature to your theme; you can delete this if you wish
66
65
// Have a look at the `src/inc/assets.php` to see how script bundles could be conditionally loaded by a theme
,dest: build+'js/'// Where the scripts end up in your theme
76
-
,lint: {
73
+
},
74
+
dest: build+'js/',// Where the scripts end up in your theme
75
+
lint: {
77
76
src: [src+'js/**/*.js']// Linting checks the quality of the code; we only lint custom scripts, not those under the various modules, so we're relying on the original authors to ship quality code
78
-
}
79
-
,minify: {
80
-
src: build+'js/**/*.js'
81
-
,uglify: {}// Default options
82
-
,dest: build+'js/'
83
-
}
84
-
,namespace: 'x-'// Script filenames will be prefaced with this (optional; leave blank if you have no need for it but be sure to change the corresponding value in `src/inc/assets.php` if you use it)
77
+
},
78
+
minify: {
79
+
src: build+'js/**/*.js',
80
+
uglify: {},// Default options
81
+
dest: build+'js/'
82
+
},
83
+
namespace: 'x-'// Script filenames will be prefaced with this (optional; leave blank if you have no need for it but be sure to change the corresponding value in `src/inc/assets.php` if you use it)
85
84
},
86
85
87
86
styles: {
88
87
build: {
89
-
src: src+'scss/**/*.scss'
90
-
,dest: build
91
-
}
92
-
,compiler: 'libsass'// Choose a Sass compiler: 'libsass' or 'rubysass'
93
-
,cssnano: {
88
+
src: src+'scss/**/*.scss',
89
+
dest: build
90
+
},
91
+
compiler: 'libsass',// Choose a Sass compiler: 'libsass' or 'rubysass'
92
+
cssnano: {
94
93
autoprefixer: {
95
-
add: true
96
-
,browsers: ['> 3%','last 2 versions','ie 9','ios 6','android 4']// This tool is magic and you should use it in all your projects :)
94
+
add: true,
95
+
browsers: ['> 3%','last 2 versions','ie 9','ios 6','android 4']// This tool is magic and you should use it in all your projects :)
97
96
}
98
-
}
99
-
,rubySass: {// Requires the Ruby implementation of Sass; run `gem install sass` if you use this; Compass is *not* included by default
100
-
loadPath: ['./src/scss',bower,modules]// Adds Bower and npm directories to the load path so you can @import directly
101
-
,precision: 6
102
-
,sourcemap: true
103
-
}
104
-
,libsass: {// Requires the libsass implementation of Sass (included in this package)
105
-
includePaths: ['./src/scss',bower,modules]// Adds Bower and npm directories to the load path so you can @import directly
106
-
,precision: 6
107
-
,onError: function(err){
97
+
},
98
+
rubySass: {// Requires the Ruby implementation of Sass; run `gem install sass` if you use this; Compass is *not* included by default
99
+
loadPath: [// Adds Bower and npm directories to the load path so you can @import directly
100
+
'./src/scss',
101
+
modules+'normalize.css',
102
+
modules+'scut/dist',
103
+
modules,
104
+
bower
105
+
],
106
+
precision: 6,
107
+
sourcemap: true
108
+
},
109
+
libsass: {// Requires the libsass implementation of Sass (included in this package)
110
+
includePaths: [// Adds Bower and npm directories to the load path so you can @import directly
111
+
'./src/scss',
112
+
modules+'normalize.css',
113
+
modules+'scut/dist',
114
+
modules,
115
+
bower,
116
+
],
117
+
precision: 6,
118
+
onError: function(err){
108
119
returnconsole.log(err);
109
120
}
110
121
}
111
122
},
112
123
113
124
theme: {
114
125
lang: {
115
-
src: src+'languages/**/*'// Glob pattern matching any language files you'd like to copy over; we've broken this out in case you want to automate language-related functions
116
-
,dest: build+'languages/'
117
-
}
118
-
,php: {
119
-
src: src+'**/*.php'// This simply copies PHP files over; both this and the previous task could be combined if you like
120
-
,dest: build
126
+
src: src+'languages/**/*',// Glob pattern matching any language files you'd like to copy over; we've broken this out in case you want to automate language-related functions
127
+
dest: build+'languages/'
128
+
},
129
+
php: {
130
+
src: src+'**/*.php',// This simply copies PHP files over; both this and the previous task could be combined if you like
131
+
dest: build
121
132
}
122
133
},
123
134
124
135
utils: {
125
-
clean: [build+'**/.DS_Store']// A glob pattern matching junk files to clean out of `build`; feel free to add to this array
126
-
,wipe: [dist]// Clean this out before creating a new distribution copy
127
-
,dist: {
128
-
src: [build+'**/*','!'+build+'**/*.map']
129
-
,dest: dist
130
-
}
131
-
,normalize: {// Copies `normalize.css` from `node_modules` to `src/scss` and renames it to allow for it to imported as a Sass file
132
-
src: modules+'normalize.css/normalize.css'
133
-
,dest: src+'scss'
134
-
,rename: '_normalize.scss'
135
-
}
136
+
clean: [build+'**/.DS_Store'],// A glob pattern matching junk files to clean out of `build`; feel free to add to this array
137
+
wipe: [dist],// Clean this out before creating a new distribution copy
138
+
dist: {
139
+
src: [build+'**/*','!'+build+'**/*.map'],
140
+
dest: dist
141
+
},
136
142
},
137
143
138
144
watch: {// What to watch before triggering each specified task; if files matching the patterns below change it will trigger BrowserSync or Livereload
139
145
src: {
140
-
styles: src+'scss/**/*.scss'
141
-
,scripts: src+'js/**/*.js'// You might also want to watch certain dependency trees but that's up to you
// Totally wipe the contents of the `dist` folder to prepare for a clean build; additionally trigger Bower-related tasks to ensure we have the latest source files
0 commit comments