Skip to content

Commit fc1d72d

Browse files
committed
add example of wrap on listingblock
1 parent 38dd773 commit fc1d72d

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

preview-src/index.adoc

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,20 @@ vfs
9797
<.> Wrap each streaming file in a buffer so the files can be processed by uglify.
9898
Uglify can only work with buffers, not streams.
9999

100+
Here's the same code with the `wrap` role added, which enables pre-wrap, if that's your speed.
101+
102+
[.wrap,js]
103+
----
104+
vfs
105+
.src('js/vendor/*.js', { cwd: 'src', cwdbase: true, read: false })
106+
.pipe(tap((file) => {
107+
file.contents = browserify(file.relative, { basedir: 'src', detectGlobals: false }).bundle()
108+
}))
109+
.pipe(buffer())
110+
.pipe(uglify())
111+
.pipe(gulp.dest('build'))
112+
----
113+
100114
Execute these commands to validate and build your site:
101115

102116
$ podman run -v $PWD:/antora:Z --rm -t antora/antora \

0 commit comments

Comments
 (0)