This repository was archived by the owner on Feb 5, 2022. It is now read-only.
File tree Expand file tree Collapse file tree 7 files changed +21
-8
lines changed Expand file tree Collapse file tree 7 files changed +21
-8
lines changed Original file line number Diff line number Diff line change @@ -30,7 +30,7 @@ $ cd /path/to/project-name
30
30
$ gulp
31
31
```
32
32
33
- To test it visit ` http://localhost:8080/ ` in your browser.
33
+ To test it visit ` http://localhost:3000 ` in your browser.
34
34
35
35
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
36
36
Original file line number Diff line number Diff line change 1
1
paths = require ' ./paths'
2
2
3
3
config =
4
+ host : " 127.0.0.1"
5
+ port : " 8080"
4
6
ext : [
5
7
" #{ paths .static .ext } /jquery/dist/jquery.js"
6
8
" #{ paths .static .ext } /moment/moment.js"
Original file line number Diff line number Diff line change 1
1
gulp = require (' gulp-help' ) require ' gulp'
2
2
yargs = require ' yargs-parser'
3
3
$ = require (' gulp-load-plugins' )()
4
+ config = require ' ../config'
4
5
paths = require ' ../paths'
5
6
6
7
@@ -55,6 +56,12 @@ gulp.task 'run',
55
56
else
56
57
options_str += " -#{ k} #{ options[k]} "
57
58
59
+ if options[' p' ]
60
+ config .port = options[' p' ]
61
+ if options[' o' ]
62
+ config .host = options[' o' ]
63
+
64
+ gulp .start (' browser-sync' )
58
65
gulp .src (' run.py' ).pipe $ .start [{
59
66
match : / run. py$ /
60
67
cmd : " python run.py #{ options_str} "
Original file line number Diff line number Diff line change 1
1
gulp = require (' gulp-help' ) require ' gulp'
2
+ browserSync = require (' browser-sync' )
2
3
$ = require (' gulp-load-plugins' )()
4
+ config = require ' ../config'
3
5
paths = require ' ../paths'
4
6
5
7
6
- gulp .task ' reload' , false , ->
7
- $ .livereload .listen 35729
8
+ gulp .task ' browser-sync' , false , ->
9
+ browserSync .init
10
+ proxy : " #{ config .host } :#{ config .port } "
11
+ notify : false
8
12
$ .watch [
9
13
" #{ paths .static .dev } /**/*.{css,js}"
10
14
" #{ paths .main } /**/*.{html,py}"
11
15
], events : [' change' ], (file ) ->
12
- $ . livereload . changed file
16
+ browserSync . reload ()
13
17
14
18
15
19
gulp .task ' ext_watch_rebuild' , false , (callback ) ->
Original file line number Diff line number Diff line change @@ -6,4 +6,4 @@ $ = require('gulp-load-plugins')()
6
6
gulp .task ' default' ,
7
7
' Start the local server, watch for changes and reload browser automatically.
8
8
For available options refer to "run" task.' ,
9
- $ .sequence ' run' , [' watch' , ' reload ' ]
9
+ $ .sequence ' run' , [' watch' ]
Original file line number Diff line number Diff line change 1
1
# if config.DEVELOPMENT
2
2
< script src ="/p/dev/script/ext.js?{{config.CURRENT_VERSION_ID}} "> </ script >
3
3
< script src ="/p/dev/script/script.js?{{config.CURRENT_VERSION_ID}} "> </ script >
4
- < script src ="http://{{request.host.split(':')[0]}}:35729/livereload.js "> </ script >
5
4
# else
6
5
< script src ="/p/min/script/ext.js?{{config.CURRENT_VERSION_ID}} "> </ script >
7
6
< script src ="/p/min/script/script.js?{{config.CURRENT_VERSION_ID}} "> </ script >
Original file line number Diff line number Diff line change 8
8
},
9
9
"scripts" : {
10
10
"install" : " gulp init" ,
11
- "postinstall" : " echo 'Run `gulp` to start or `gulp help` for more.'"
11
+ "postinstall" : " echo 'Run `gulp` to start or `gulp help` for more.'" ,
12
+ "start" : " gulp"
12
13
},
13
14
"devDependencies" : {
15
+ "browser-sync" : " 2.18.8" ,
14
16
"bower" : " 1.8.0" ,
15
17
"coffee-script" : " 1.12.4" ,
16
18
"del" : " 2.2.2" ,
23
25
"gulp-help" : " 1.6.1" ,
24
26
"gulp-if" : " 2.0.2" ,
25
27
"gulp-less" : " 3.3.0" ,
26
- "gulp-livereload" : " 3.8.1" ,
27
28
"gulp-load-plugins" : " 1.5.0" ,
28
29
"gulp-plumber" : " 1.1.0" ,
29
30
"gulp-sequence" : " 0.4.6" ,
You can’t perform that action at this time.
0 commit comments