File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 5656 "@rollup/plugin-terser" : " ^0.4.4" ,
5757 "autoprefixer" : " ^10.4.21" ,
5858 "browser-sync" : " 3.0.3" ,
59- "connect" : " ^3.7.0" ,
6059 "cross-env" : " ^7.0.3" ,
6160 "editorconfig-checker" : " ^6.0.1" ,
6261 "eslint" : " ^8.57.0" ,
9695 "puppeteer" : " ^24.6.0" ,
9796 "rollup" : " ^4.38.0" ,
9897 "sass-export" : " ^2.1.2" ,
99- "serve-static" : " ^1.16.2" ,
10098 "sitemap" : " ^8.0.0" ,
10199 "slash" : " ^3.0.0" ,
102100 "slug" : " ^9.1.0" ,
Original file line number Diff line number Diff line change 1- const { createServer } = require ( 'http ' )
1+ const { paths , ports } = require ( '../config ' )
22
3- const connect = require ( 'connect' )
4- const serveStatic = require ( 'serve-static' )
3+ const browserSync = require ( 'browser-sync' ) . create ( )
54
6- const { paths, ports } = require ( '../config' )
5+ browserSync . init ( {
6+ // Prevent browser mirroring
7+ ghostMode : false ,
8+
9+ // Prevent browser opening
10+ open : false ,
11+
12+ // Disable BrowserStack UI
13+ ui : false ,
714
8- // Create a simple server for serving static files
9- const app = connect ( ) . use ( serveStatic ( paths . public ) )
10- const server = createServer ( app )
15+ // Configure port
16+ port : ports . preview ,
1117
12- server . listen ( ports . preview , ( ) => {
13- console . log ( `Server started at http://localhost:${ ports . preview } ` )
18+ // Serve files from directory
19+ server : paths . public
20+ } , ( err , bs ) => {
21+ if ( err ) {
22+ console . error ( 'Encountered an error starting the local server:' , err ) ;
23+ }
24+ else {
25+ console . log ( `Server started at http://localhost:${ bs . options . get ( 'port' ) } ` )
26+ }
1427} )
You can’t perform that action at this time.
0 commit comments