File tree Expand file tree Collapse file tree 3 files changed +31
-6
lines changed Expand file tree Collapse file tree 3 files changed +31
-6
lines changed Original file line number Diff line number Diff line change 11"use strict" ;
22
3- var path = require ( "path" ) ;
4- var anymatch = require ( "anymatch " ) ;
5- var utils = require ( "./public-utils" ) ;
3+ var path = require ( "path" ) ;
4+ var micromatch = require ( "micromatch " ) ;
5+ var utils = require ( "./public-utils" ) ;
66
77/**
88 * @param emitter
@@ -43,7 +43,7 @@ module.exports = function (emitter) {
4343 * current filepath against it
4444 */
4545 if ( opts . match ) {
46- if ( ! anymatch ( opts . match , file . path ) ) {
46+ if ( ! micromatch ( file . path , opts . match , { dot : true } ) . length ) {
4747 return end ( ) ;
4848 }
4949 }
Original file line number Diff line number Diff line change 3030 "pre-release" : " npm test && npm run pro-local && npm run pro"
3131 },
3232 "dependencies" : {
33- "anymatch" : " ^1.3.0" ,
3433 "async-each-series" : " ^0.1.1" ,
3534 "browser-sync-client" : " ^2.3.3" ,
3635 "browser-sync-ui" : " ^0.5.16" ,
3736 "bs-recipes" : " ^1.0.5" ,
38- "chokidar" : " ^1.0.5 " ,
37+ "chokidar" : " 1.4.1 " ,
3938 "connect" : " ^3.4.0" ,
4039 "dev-ip" : " ^1.0.1" ,
4140 "easy-extender" : " ^2.3.1" ,
4847 "lodash" : " ^3.9.3" ,
4948 "longest" : " ^1.0.1" ,
5049 "meow" : " 3.3.0" ,
50+ "micromatch" : " 2.3.5" ,
5151 "opn" : " ^3.0.2" ,
5252 "portscanner" : " ^1.0.0" ,
5353 "query-string" : " ^2.4.0" ,
Original file line number Diff line number Diff line change @@ -113,6 +113,31 @@ describe("API: .stream()", function () {
113113 clock . tick ( ) ;
114114 sinon . assert . notCalled ( emitterStub ) ;
115115 } ) ;
116+ it ( "accepts file paths beginning with dots" , function ( ) {
117+ var stream = browserSync . stream ( { match : "**/*.css" } ) ;
118+ stream . write ( new File ( { path : "/users/shakyshane/.tmp/css/core.css" } ) ) ;
119+ stream . write ( new File ( { path : "/users/shakyshane/.tmp/css/core.css.map" } ) ) ;
120+ stream . end ( ) ;
121+ clock . tick ( ) ;
122+ sinon . assert . calledWithExactly ( emitterStub , "file:changed" , {
123+ path : "/users/shakyshane/.tmp/css/core.css" ,
124+ basename : "core.css" ,
125+ log : false ,
126+ namespace : "core" ,
127+ event : "change" ,
128+ ext : "css"
129+ } ) ;
130+ sinon . assert . calledWithExactly ( emitterStub , "file:reload" , {
131+ ext : "css" ,
132+ path : "/users/shakyshane/.tmp/css/core.css" ,
133+ basename : "core.css" ,
134+ type : "inject" ,
135+ log : false
136+ } ) ;
137+ sinon . assert . calledWithExactly ( emitterStub , "stream:changed" , {
138+ changed : [ "core.css" ]
139+ } ) ;
140+ } ) ;
116141 it ( "emits the stream:changed event with an array of changed files" , function ( ) {
117142
118143 var stream = browserSync . stream ( ) ;
You can’t perform that action at this time.
0 commit comments