|
28 | 28 |
|
29 | 29 | ## Installation |
30 | 30 |
|
31 | | -There are a few ways to install: |
| 31 | +Follow our [Quick Start guide][quick-start]. |
32 | 32 |
|
33 | | -* gulp v4.0.0 - `npm install gulp@next` |
34 | | -* gulp v4.0.0-alpha.3 - `npm install gulpjs/gulp#v4.0.0-alpha.3` |
35 | | -* gulp v3.9.1 - `npm install gulp` |
| 33 | +## Roadmap |
| 34 | + |
| 35 | +Find out about all our work-in-progress and outstanding issues at https://github.com/orgs/gulpjs/projects. |
36 | 36 |
|
37 | 37 | ## Documentation |
38 | 38 |
|
39 | | -For a Getting started guide, API docs, recipes, making a plugin, etc. check out our docs! |
| 39 | +Check out the [Getting Started guide][getting-started-guide] and [API docs][api-docs] on our website! |
40 | 40 |
|
41 | | -- Check out the [documentation for v4.0.0](/docs/README.md)! __Excuse our dust; these docs might be behind while we get everything updated. Please open an issue if something isn't working.__ |
42 | | -- Using the older v3.9.1? Check out the [documentation at the v3.9.1 tag](https://github.com/gulpjs/gulp/tree/v3.9.1/docs)! |
| 41 | +__Excuse our dust! All other docs will be behind until we get everything updated. Please open an issue if something isn't working.__ |
43 | 42 |
|
44 | 43 | ## Sample `gulpfile.js` |
45 | 44 |
|
@@ -104,28 +103,23 @@ function watch() { |
104 | 103 | gulp.watch(paths.styles.src, styles); |
105 | 104 | } |
106 | 105 |
|
107 | | -/* |
108 | | - * You can use CommonJS `exports` module notation to declare tasks |
109 | | - */ |
110 | | -exports.clean = clean; |
111 | | -exports.styles = styles; |
112 | | -exports.scripts = scripts; |
113 | | -exports.watch = watch; |
114 | | - |
115 | 106 | /* |
116 | 107 | * Specify if tasks run in series or parallel using `gulp.series` and `gulp.parallel` |
117 | 108 | */ |
118 | 109 | var build = gulp.series(clean, gulp.parallel(styles, scripts)); |
119 | 110 |
|
120 | 111 | /* |
121 | | - * You can still use `gulp.task` to expose tasks |
| 112 | + * You can use CommonJS `exports` module notation to declare tasks |
122 | 113 | */ |
123 | | -gulp.task('build', build); |
124 | | - |
| 114 | +exports.clean = clean; |
| 115 | +exports.styles = styles; |
| 116 | +exports.scripts = scripts; |
| 117 | +exports.watch = watch; |
| 118 | +exports.build = build; |
125 | 119 | /* |
126 | 120 | * Define default task that can be called by just running `gulp` from cli |
127 | 121 | */ |
128 | | -gulp.task('default', build); |
| 122 | +exports.default = build; |
129 | 123 | ``` |
130 | 124 |
|
131 | 125 | ## Use latest JavaScript version in your gulpfile |
@@ -204,13 +198,7 @@ function watchFiles() { |
204 | 198 | } |
205 | 199 | export { watchFiles as watch }; |
206 | 200 |
|
207 | | -/* |
208 | | - * You can still use `gulp.task` |
209 | | - * for example to set task names that would otherwise be invalid |
210 | | - */ |
211 | 201 | const build = gulp.series(clean, gulp.parallel(styles, scripts)); |
212 | | -gulp.task('build', build); |
213 | | - |
214 | 202 | /* |
215 | 203 | * Export a default task |
216 | 204 | */ |
@@ -244,40 +232,6 @@ Task run times are saved in memory and are lost when gulp exits. It will only |
244 | 232 | save time during the `watch` task when running the `images` task |
245 | 233 | for a second time. |
246 | 234 |
|
247 | | -If you want to compare modification time between files instead, we recommend these plugins: |
248 | | -- [gulp-changed]; |
249 | | -- or [gulp-newer] - supports many:1 source:dest. |
250 | | - |
251 | | -[gulp-newer] example: |
252 | | -```js |
253 | | -function images() { |
254 | | - var dest = 'build/img'; |
255 | | - return gulp.src(paths.images) |
256 | | - .pipe(newer(dest)) // pass through newer images only |
257 | | - .pipe(imagemin({optimizationLevel: 5})) |
258 | | - .pipe(gulp.dest(dest)); |
259 | | -} |
260 | | -``` |
261 | | - |
262 | | -If you can't simply filter out unchanged files, but need them in a later phase |
263 | | -of the stream, we recommend these plugins: |
264 | | -- [gulp-cached] - in-memory file cache, not for operation on sets of files |
265 | | -- [gulp-remember] - pairs nicely with gulp-cached |
266 | | - |
267 | | -[gulp-remember] example: |
268 | | -```js |
269 | | -function scripts() { |
270 | | - return gulp.src(scriptsGlob) |
271 | | - .pipe(cache('scripts')) // only pass through changed files |
272 | | - .pipe(header('(function () {')) // do special things to the changed files... |
273 | | - .pipe(footer('})();')) // for example, |
274 | | - // add a simple module wrap to each file |
275 | | - .pipe(remember('scripts')) // add back all files to the stream |
276 | | - .pipe(concat('app.js')) // do things that require all files |
277 | | - .pipe(gulp.dest('public/')) |
278 | | -} |
279 | | -``` |
280 | | - |
281 | 235 | ## Want to contribute? |
282 | 236 |
|
283 | 237 | Anyone can help make this project better - check out our [Contributing guide](/CONTRIBUTING.md)! |
@@ -320,7 +274,6 @@ Become a sponsor to get your logo on our README on Github. |
320 | 274 | [backers-image]: https://opencollective.com/gulpjs/backers.svg |
321 | 275 | [sponsors-image]: https://opencollective.com/gulpjs/sponsors.svg |
322 | 276 |
|
323 | | -[gulp-cached]: https://github.com/contra/gulp-cached |
324 | | -[gulp-remember]: https://github.com/ahaurw01/gulp-remember |
325 | | -[gulp-changed]: https://github.com/sindresorhus/gulp-changed |
326 | | -[gulp-newer]: https://github.com/tschaub/gulp-newer |
| 277 | +[quick-start]: https://gulpjs.com/docs/en/getting-started/quick-start |
| 278 | +[getting-started-guide]: https://gulpjs.com/docs/en/getting-started/quick-start |
| 279 | +[api-docs]: https://gulpjs.com/docs/en/api/concepts |
0 commit comments