Skip to content
This repository was archived by the owner on Oct 23, 2020. It is now read-only.

Commit 26f4935

Browse files
committed
🚀 RELEASE: Update to Gulp 4
1 parent d591eab commit 26f4935

File tree

14 files changed

+1187
-737
lines changed

14 files changed

+1187
-737
lines changed

.babelrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
"presets": ["@babel/env"]
2+
"presets": ["@babel/preset-env"]
33
}

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Distribution Files
22
app
3+
dist
4+
build
5+
tmp
6+
backups
37

48
# IDE & Editors
59
.idea

README.md

Lines changed: 56 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,17 @@ ___
77

88
# Features ⚡️
99
* Processing styles using [PostCSS](https://postcss.org/) with [postcss-preset-env](https://preset-env.cssdb.org/)
10-
* Babel Transpiler for JavaScript (ES6)
11-
* JavaScript Concatenating and Minification
12-
* CSS Minification
13-
* HTML Minification
14-
* Image Compression
15-
* Asset Copying
16-
* Templating & Partial HTML Injection
17-
* Cache-Busting
18-
* Server for viewing built site
19-
* Live-Reload for the dev environment
20-
* Creates `app/` directory with built content and assets
10+
* Babel transpiler for JavaScript (ES6)
11+
* JavaScript concatenating and minification
12+
* CSS minification
13+
* HTML minification
14+
* Image compression
15+
* Assets copying
16+
* Templating & partial HTML injection
17+
* Cache-busting
18+
* Local development server
19+
* Live-reload for the development environment
20+
* Distribution files: `build/`.
2121

2222
___
2323

@@ -98,13 +98,14 @@ To avoid repetitive **HTML** code the build uses [gulp-file-include](https://git
9898

9999
## File Structure 🏗
100100

101-
├── app/ # Distribution files
101+
├── build/ # Build files
102+
├── dist/ # Distribution files
102103
├── src/ # Source files
103104
│ ├── assets/ # Assets directory
104-
│ ├── img/ # Image directory
105+
│ ├── css/ # CSS files
105106
│ ├── fonts/ # Fonts directory
107+
│ ├── img/ # Image directory
106108
│ ├── js/ # JavaScript files
107-
│ ├── styles/ # CSS files
108109
│ ├── etc/ # Additional build files
109110
│ ├── includes/ # Included partials
110111
├── tools/ # Tools and utilities
@@ -127,17 +128,12 @@ $ npm run prod
127128
```
128129
The files will be generated in the `app/` directory. The production build automatically minifies the html and css. By default also the javascript files are concatenated in one bundle: `assets/js/bundle.js`.
129130

130-
# Image Optimization 🌅
131-
For image optimization and SVG compression run:
132-
```
133-
$ npm run images
134-
```
135-
136131
# Gulpfile.js
137132
**Note:** The `Gulpfile.js` requires a build restart for any changes to take effect.
138133

139134
### PostCSS Plugins 🎨
140-
Currently, [PostCSS](http://postcss.org/) has more than 200 plugins. You can find all of the plugins in the [plugins list] or in the [searchable catalog]. [CSSNext](http://cssnext.io/) is installed in the default configuration.
135+
Currently, [PostCSS](http://postcss.org/) has more than 200 plugins. You can find all of the plugins in the [plugins list] or in the [searchable catalog]. [ostcss-preset-env
136+
](https://preset-env.cssdb.org/) is installed in the default configuration.
141137

142138
[searchable catalog]: http://postcss.parts
143139
[plugins list]: https://github.com/postcss/postcss/blob/master/docs/plugins.md
@@ -146,14 +142,35 @@ Currently, [PostCSS](http://postcss.org/) has more than 200 plugins. You can fi
146142
/* -------------------------------------------------------------------------------------------------
147143
PostCSS Plugins
148144
------------------------------------------------------------------------------------------------- */
149-
var pluginsDev = [
150-
partialimport,
151-
cssnext()
145+
const pluginsDev = [
146+
postcssImport,
147+
postcssPresetEnv({
148+
stage: 0,
149+
features: {
150+
'nesting-rules': true,
151+
'color-mod-function': true,
152+
'custom-media': true,
153+
},
154+
}),
152155
];
153-
var pluginsProd = [
154-
partialimport,
155-
cssnext(),
156-
cssnano()
156+
const pluginsProd = [
157+
postcssImport,
158+
postcssPresetEnv({
159+
stage: 0,
160+
features: {
161+
'nesting-rules': true,
162+
'color-mod-function': true,
163+
'custom-media': true,
164+
},
165+
}),
166+
require('cssnano')({
167+
preset: [
168+
'default',
169+
{
170+
discardComments: true,
171+
},
172+
],
173+
}),
157174
];
158175
//--------------------------------------------------------------------------------------------------
159176
```
@@ -165,12 +182,13 @@ JavaScript files located in the project source directory `src/assets/js/` and ar
165182
/* -------------------------------------------------------------------------------------------------
166183
Your JavaScript Files
167184
------------------------------------------------------------------------------------------------- */
168-
var headerJS = [
169-
'node_modules/aos/dist/aos.js'
185+
const headerJS = [
186+
'./src/etc/analytics.js',
187+
'./node_modules/aos/dist/aos.js'
170188
];
171-
var footerJS = [
172-
'node_modules/jquery/dist/jquery.js',
173-
'src/assets/js/**'
189+
const footerJS = [
190+
'./node_modules/jquery/dist/jquery.js',
191+
'./src/assets/js/**'
174192
];
175193
//--------------------------------------------------------------------------------------------------
176194
```
@@ -185,7 +203,7 @@ ___
185203
* browserSync
186204
* Babel
187205
* PostCSS
188-
* CSSNext
206+
* postcss-preset-env
189207

190208
___
191209

@@ -198,6 +216,10 @@ It is advised to run the command `$ npm run lint:css` before pushing changes, to
198216
MIT
199217

200218
# Changelog
219+
**v0.0.6**
220+
- Upgrade to Gulp 4.
221+
- Rewrote all tasks into functions.
222+
- Updated file structure.
201223

202224
**v0.0.5**
203225
- Added support for static server using Express.

0 commit comments

Comments
 (0)