@@ -101,21 +101,23 @@ module.exports = function (defaults) {
101101 'dist' ,
102102 ) ;
103103
104- for ( const dist of [ 'basic' , 'chrome' , 'firefox' , 'bookmarklet' ] ) {
105- const entryPoint = concatFiles (
106- new Funnel ( emberDebug , {
107- destDir : 'ember-debug' ,
108- include : [ `${ dist } -debug.js` ] ,
109- } ) ,
110- {
111- inputFiles : [ '**/*.js' ] ,
112- outputFile : '/ember_debug.js' ,
113- sourceMapConfig : { enabled : false } ,
114- } ,
115- ) ;
104+ [ 'basic' , 'chrome' , 'firefox' , 'bookmarklet' , 'websocket' ] . forEach (
105+ function ( dist ) {
106+ let entryPoint = concatFiles (
107+ new Funnel ( emberDebug , {
108+ destDir : 'ember-debug' ,
109+ include : [ `${ dist } -debug.js` ] ,
110+ } ) ,
111+ {
112+ inputFiles : [ '**/*.js' ] ,
113+ outputFile : '/ember_debug.js' ,
114+ sourceMapConfig : { enabled : false } ,
115+ } ,
116+ ) ;
116117
117- emberDebugs [ dist ] = mergeTrees ( [ emberDebug , entryPoint ] ) ;
118- }
118+ emberDebugs [ dist ] = mergeTrees ( [ emberDebug , entryPoint ] ) ;
119+ } ,
120+ ) ;
119121
120122 let tree = app . toTree ( ) ;
121123
@@ -241,6 +243,7 @@ module.exports = function (defaults) {
241243 chrome,
242244 firefox,
243245 bookmarklet,
246+ websocket : mergeTrees ( [ tree , emberDebugs . websocket ] ) ,
244247 basic : mergeTrees ( [ tree , emberDebugs . basic ] ) ,
245248 } ;
246249 Object . keys ( dists ) . forEach ( function ( key ) {
@@ -255,6 +258,20 @@ module.exports = function (defaults) {
255258 } ) ;
256259 } ) ;
257260
261+ // Add {{ remote-port }} to the head
262+ // so that the websocket addon can replace it.
263+ dists . websocket = replace ( dists . websocket , {
264+ files : [ 'index.html' ] ,
265+ patterns : [
266+ {
267+ match : / < h e a d > / ,
268+ replacement : '<head>\n{{ remote-port }}\n' ,
269+ } ,
270+ ] ,
271+ } ) ;
272+
273+ let output ;
274+
258275 if ( env === 'test' ) {
259276 // `ember test` expects the index.html file to be in the
260277 // output directory.
@@ -268,16 +285,18 @@ module.exports = function (defaults) {
268285 } ,
269286 ] ,
270287 } ) ;
271-
272- return mergeTrees ( [ dists . basic , dists . chrome ] ) ;
288+ output = mergeTrees ( [ dists . basic , dists . chrome ] ) ;
289+ } else {
290+ dists . testing = mergeTrees ( [ dists . basic , dists . chrome ] ) ;
291+
292+ output = mergeTrees ( [
293+ mv ( dists . bookmarklet , 'bookmarklet' ) ,
294+ mv ( dists . firefox , 'firefox' ) ,
295+ mv ( dists . chrome , 'chrome' ) ,
296+ mv ( dists . websocket , 'websocket' ) ,
297+ mv ( dists . testing , 'testing' ) ,
298+ ] ) ;
273299 }
274300
275- dists . testing = mergeTrees ( [ dists . basic , dists . chrome ] ) ;
276-
277- return mergeTrees ( [
278- mv ( dists . bookmarklet , 'bookmarklet' ) ,
279- mv ( dists . firefox , 'firefox' ) ,
280- mv ( dists . chrome , 'chrome' ) ,
281- mv ( dists . testing , 'testing' ) ,
282- ] ) ;
301+ return output ;
283302} ;
0 commit comments