Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to serve angular2 app without browsersync

In my package.json I have the following:

...
"scripts": {
        "tsc": "tsc",
        "tsc:w": "tsc -w --outDir build",
        "lite": "lite-server",
        "start": "concurrent \"npm run tsc:w\" \"npm run lite\" "
    },
...

and I was wondering how could I start the app using "npm production" or something similar?

I'd want to prevent browsersync from running: I just tried with multiple users and it was hilarious to see that they were scrolling "as one". This also happens accross different browsers (but not using different tabs).

like image 936
PascalVKooten Avatar asked Apr 13 '16 14:04

PascalVKooten


People also ask

Can angular run without a server?

You don't need a server-side engine to dynamically compose application pages because Angular does that on the client-side. If the application uses the Angular router, you must configure the server to return the application's host page ( index.html ) when asked for a file that it does not have.

What is BrowserSync used for?

The BrowserSync is used to watch all HTML and CSS files in the css directory and performs the live reload to the page in all browsers whenever files were changed. BrowserSync makes workflow faster by synchronizing URL's, interactions and code changes across multiple devices.

What is BrowserSync io?

Browsersync is an open-source project with over 2 million npm downloads a month and is a dependency of nearly a million separate projects on github.

What is BrowserSync Javascript?

BrowserSync makes your tweaking and testing faster by syncronising file changes and interactions across multiple devices.


1 Answers

You could use serve instead of lite-server.

like image 120
kemsky Avatar answered Oct 15 '22 02:10

kemsky