i use template angular 2 project. project doesn't use gulp, or webpack. i'm new on angular 2. if open multiple web browsers on different computers mirror of on specific one. how can disable this? don't see config file of port (it 3000 don't know how change it) or config file browser sync... i'm confused!
also, start project command:
npm start
here files:
update 1
systemjs.config.js /** * system configuration angular samples * adjust necessary application needs. */ (function (global) { system.config({ paths: { // paths serve alias 'npm:': 'node_modules/' }, // map tells system loader things map: { // our app within app folder app: 'app', // angular bundles '@angular/core': 'npm:@angular/core/bundles/core.umd.js', '@angular/common': 'npm:@angular/common/bundles/common.umd.js', '@angular/compiler': 'npm:@angular/compiler/bundles/compiler.umd.js', '@angular/platform-browser': 'npm:@angular/platform-browser/bundles/platform-browser.umd.js', '@angular/platform-browser-dynamic': 'npm:@angular/platform-browser-dynamic/bundles/platform-browser-dynamic.umd.js', '@angular/http': 'npm:@angular/http/bundles/http.umd.js', '@angular/router': 'npm:@angular/router/bundles/router.umd.js', '@angular/forms': 'npm:@angular/forms/bundles/forms.umd.js', '@angular/upgrade': 'npm:@angular/upgrade/bundles/upgrade.umd.js', // other libraries 'rxjs': 'npm:rxjs', 'angular-in-memory-web-api': 'npm:angular-in-memory-web-api/bundles/in-memory-web-api.umd.js', 'angular2-jwt': 'npm:angular2-jwt/angular2-jwt.js', 'ng2-toasty': 'node_modules/ng2-toasty/bundles/index.umd.js' }, // packages tells system loader how load when no filename and/or no extension packages: { app: { main: './main.js', defaultextension: 'js' }, rxjs: { defaultextension: 'js' }, "angular2-jwt": { "defaultextension": "js" }, } }); })(this); package.json { "name": "cayena-oak", "private": true, "version": "1.1.1", "scripts": { "start": "tsc && concurrently \"tsc -w\" \"lite-server\" ", "lite": "lite-server", "tsc": "tsc", "tsc:w": "tsc -w" }, "engines": { "node": "5.9.1" }, "license": "mit", "repository": { "type": "git", "url": "https://github.com/creativetimofficial/light-bootstrap-dashboard-angular.git" }, "bugs": { "url": "https://github.com/creativetimofficial/light-bootstrap-dashboard-angular/issues" }, "dependencies": { "@angular/common": "~2.2.2", "@angular/compiler": "~2.2.2", "@angular/core": "~2.2.2", "@angular/forms": "~2.2.2", "@angular/http": "~2.2.2", "@angular/platform-browser": "~2.2.2", "@angular/platform-browser-dynamic": "~2.2.2", "@angular/router": "~3.2.2", "@angular/upgrade": "~2.2.2", "@types/core-js": "0.9.35", "@types/node": "^6.0.45", "angular-in-memory-web-api": "~0.1.13", "angular2-chartist": "~0.10.1", "angular2-google-maps": "~0.16.0", "angular2-jwt": "^0.1.28", "chartist": "~0.9.8", "compression": "^1.6.2", "core-js": "2.4.1", "jquery": "~3.1.1", "ng2-bootstrap": "~1.1.16", "ng2-toasty": "^2.5.0", "reflect-metadata": "~0.1.8", "rxjs": "5.0.0-rc.5", "systemjs": "~0.19.41", "systemjs-builder": "^0.15.17", "typescript": "^2.0.3", "yargs": "^4.7.1", "zone.js": "0.7.2" }, "devdependencies": { "@types/chartist": "~0.9.33", "@types/core-js": "~0.9.34", "@types/jquery": "~2.0.34", "@types/node": "~6.0.45", "concurrently": "^3.0.0", "lite-server": "~2.2.2", "typescript": "~2.0.3", "ejs": ">= 0.0.1", "express": "~4.9.8", "nodemon": "^1.11.0", "systemjs": "0.19.39" } }
anybody can me?
you need find browsersync instance initialized, , change ghostmode
false.
search code repository browsersync.init
, see if can see initialized, , can modify init options. think in systemjs.config.js
it's hard without seeing code.
if can't find it, try tracing through package configuration, start @ packages.json
, find start command, see runs, , files loads, , trace until find browsersync initialization.
reference: how disable cross-device action mirroring functionality of browsersync? (ghostmode)
edit
regarding comment, looks you're using lite-server in order run application. override default browsersync configuration, need create file named my-bs-config.json
overwrite default configuration, , put in file:
{ "ghost": false }
and change "start" command in package.json run lite-server new configuration file, along these lines:
lite-server -c my-bs-config.json
so new command be:
"start": "tsc && concurrently \"tsc -w\" \"lite-server -c my-bs-config.json\" "
i haven't tested ensure works, may need tweak command bit work. if have trouble, leave comment , i'll try fix command you.
this based off of lite-server
documentation, can found here.
Comments
Post a Comment