File tree Expand file tree Collapse file tree 6 files changed +5133
-3792
lines changed Expand file tree Collapse file tree 6 files changed +5133
-3792
lines changed Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ import { globbySync } from 'globby'
5
5
import gulpIf from 'gulp-if'
6
6
import babel from 'gulp-babel'
7
7
import rename from 'gulp-rename'
8
- import multiDest from 'gulp- multi-dest'
8
+ import multiDest from './ multi-dest.mjs '
9
9
import logger from 'gulp-logger'
10
10
import plumber from 'gulp-plumber'
11
11
import notify from 'gulp-notify'
Original file line number Diff line number Diff line change
1
+ import through from 'through2' ;
2
+ import gulp from 'gulp' ;
3
+ import async from 'async' ;
4
+
5
+ export default function ( paths , options ) {
6
+ options = options || { } ;
7
+ var writtenFiles = [ ] ;
8
+
9
+ if ( typeof paths === 'string' ) {
10
+ paths = [ paths ] ;
11
+ }
12
+
13
+ var dests = paths . map ( function ( path ) {
14
+ return gulp . dest ( path , options ) ;
15
+ } ) ;
16
+
17
+ function writeFileToMultipleDestinations ( file , encoding , done ) {
18
+ async . each ( dests , function ( dest , wroteFileToDest ) {
19
+ var fileClone = file . clone ( ) ;
20
+ dest . write ( fileClone , function ( ) {
21
+ writtenFiles . push ( fileClone ) ;
22
+ wroteFileToDest ( ) ;
23
+ } ) ;
24
+ } ) ;
25
+ done ( null , file ) ;
26
+ }
27
+
28
+ function flushCreatedFiles ( done ) {
29
+ var stream = this ;
30
+ for ( var i = 0 ; i < writtenFiles . length ; i ++ ) {
31
+ var file = writtenFiles [ i ] ;
32
+ stream . push ( file ) ;
33
+ }
34
+ done ( ) ;
35
+ }
36
+
37
+ return through . obj ( writeFileToMultipleDestinations , flushCreatedFiles ) ;
38
+ } ;
Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ import dartSass from 'sass'
5
5
import nodeSass from 'node-sass'
6
6
import gulpSass from 'gulp-sass'
7
7
import rename from 'gulp-rename'
8
- import multiDest from 'gulp- multi-dest'
8
+ import multiDest from './ multi-dest.mjs '
9
9
import logger from 'gulp-logger'
10
10
import plumber from 'gulp-plumber'
11
11
import notify from 'gulp-notify'
Original file line number Diff line number Diff line change 1
1
import gulp from 'gulp'
2
2
import path from 'path'
3
3
import gulpIf from 'gulp-if'
4
- import multiDest from 'gulp- multi-dest'
4
+ import multiDest from './ multi-dest.mjs '
5
5
import logger from 'gulp-logger'
6
6
import plumber from 'gulp-plumber'
7
7
import notify from 'gulp-notify'
You can’t perform that action at this time.
0 commit comments