![]() Server.watch('assets/*.styl', shell('make assets', cwd='assets')) Server.watch('style.less', shell(, output='style.css')) Server.watch('style.less', shell('lessc style.less', output='style.css')) You can use it with server.watch: # you can redirect command output to a file The powerful shell function will help you to execute shell commands. # open the web browser on startup, based on $BROWSER environment variable It can create a static server and a livereload server: # use default settings tHeader('Access-Control-Allow-Methods', '*') `tHeader` can be used to add one or more headers to the HTTP response: tHeader('Access-Control-Allow-Origin', '*') You can delay a certain seconds to send the reload signal: # delay 2 seconds for reloading You can also use other library (for example: formic) for more powerful file adding: for filepath in formic.FileSet(include="**.css"): Server.watch can watch a filepath, a directory and a glob pattern: server.watch('path/to/file.txt')
0 Comments
Leave a Reply. |