Skip to content

Commit e1a5ac8

Browse files
committed
readme: add cache for watch examples
1 parent 5c1543a commit e1a5ac8

File tree

4 files changed

+16
-2
lines changed

4 files changed

+16
-2
lines changed

README.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,11 @@ const reduce = require('reduce-css')
136136

137137
const build = __dirname + '/build'
138138
const basedir = __dirname + '/src'
139-
const b = reduce.create({ basedir })
139+
const b = reduce.create({
140+
basedir,
141+
cache: {},
142+
packageCache: {},
143+
})
140144

141145
reduce.src('*.css', { cwd: basedir })
142146
.pipe(reduce.watch(b, 'bundle.css', { entryGlob: '*.css' }))
@@ -262,6 +266,8 @@ const path = require('path')
262266
const b = reduce.create({
263267
entries: ['a.css', 'b.css'],
264268
basedir: '/path/to/src',
269+
cache: {},
270+
packageCache: {},
265271
})
266272
b.plugin(reduce.bundler, 'bundle.css')
267273
b.plugin(reduce.watcher, { entryGlob: '*.css' })

example/gulp/multi/gulpfile.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ gulp.task('watch', ['clean'], function () {
3737
resolve: {
3838
paths: [path.join(__dirname, 'src', 'web_modules')],
3939
},
40+
cache: {},
41+
packageCache: {},
4042
})
4143
let count = 1
4244
return gulp.src('page/**/index.css', { cwd: basedir })

example/gulp/reduce/gulpfile.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ gulp.task('watch', ['clean'], function () {
3434
resolve: {
3535
paths: [path.join(__dirname, 'src', 'web_modules')],
3636
},
37+
cache: {},
38+
packageCache: {},
3739
})
3840
let count = 1
3941
return gulp.src('page/**/index.css', { cwd: basedir })

example/without-gulp/watch.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,11 @@ const reduce = require('reduce-css')
55

66
const build = __dirname + '/build'
77
const basedir = __dirname + '/src'
8-
const b = reduce.create({ basedir })
8+
const b = reduce.create({
9+
basedir,
10+
cache: {},
11+
packageCache: {},
12+
})
913

1014
del(build).then(function () {
1115
reduce.src('*.css', { cwd: basedir })

0 commit comments

Comments
 (0)