mirror of
				https://github.com/fooflington/selfdefined.git
				synced 2025-11-03 23:29:03 +00:00 
			
		
		
		
	update
This commit is contained in:
		
							
								
								
									
										25
									
								
								node_modules/bs-recipes/recipes/server.includes/app.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										25
									
								
								node_modules/bs-recipes/recipes/server.includes/app.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,25 @@
 | 
			
		||||
/**
 | 
			
		||||
 * Require Browsersync
 | 
			
		||||
 */
 | 
			
		||||
var browserSync = require('browser-sync').create();
 | 
			
		||||
var fs = require('fs');
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Run Browsersync with server config
 | 
			
		||||
 */
 | 
			
		||||
browserSync.init({
 | 
			
		||||
    server: 'app',
 | 
			
		||||
    files: ['app/*.html', 'app/css/*.css'],
 | 
			
		||||
    rewriteRules: [
 | 
			
		||||
        {
 | 
			
		||||
            match: /@include\("(.+?)"\)/g,
 | 
			
		||||
            fn: function (match, filename) {
 | 
			
		||||
                if (fs.existsSync(filename)) {
 | 
			
		||||
                    return fs.readFileSync(filename);
 | 
			
		||||
                } else {
 | 
			
		||||
                    return '<span style="color: red">'+filename+' could not be found</span>';
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
    ]
 | 
			
		||||
});
 | 
			
		||||
		Reference in New Issue
	
	Block a user