2016-06-25 4 views
0

Ich benutze Angular 2. Ich möchte Browser Sync deaktivieren/löschen. Aber kann nicht herausfinden, wie es geht, oder über cmd oder code? Welcher Weg? Hilfe nötig)Wo kann BrowserSync deaktiviert werden? Pfad? Dateien? Konsole? Angular 2

Version 2.0.0 Winkel-rc.1"

"Projest structure: 
-Build/ 
-NodeModules/ 
-SRC/ 
-Typings/ 
-gunlpfile.ts 
-bsconfig.json 
-tsconfig.json 
-tslint.json 
-typings.json" 

das ist gulpfile.ts:

"use strict"; 

const gulp = require("gulp"); 
const del = require("del"); 
const sass = require('gulp-sass'); 
const tsc = require("gulp-typescript"); 
const sourcemaps = require('gulp-sourcemaps'); 
const tsProject = tsc.createProject("tsconfig.json"); 
const tslint = require('gulp-tslint'); 


gulp.task('clean', (cb) => { 
return del(["build"], cb); 
}); 

weiter

gulp.task('tslint',() => { 
return gulp.src("src/**/*.ts") 
    .pipe(tslint()) 
    .pipe(tslint.report('prose')); 
}); 


gulp.task("compile", ["tslint"],() => { 
let tsResult = gulp.src("src/**/*.ts") 
    .pipe(sourcemaps.init()) 
    .pipe(tsc(tsProject)) 
    .pipe(sourcemaps.write(".")) 
    .pipe(gulp.dest("build")); 
}); 


gulp.task("sass",() => { 
return gulp.src("src/**/*.{sass,scss}") 
.pipe(sourcemaps.init()) 
.pipe(sass().on('error', sass.logError)) 
.pipe(sourcemaps.write(".")) 
.pipe(gulp.dest("build")); 
}); 


gulp.task("resources",() => { 
return gulp.src(["src/**/*", "!**/*.{sass,scss,ts}"]) 
    .pipe(sourcemaps.write()) 
    .pipe(gulp.dest("build")); 
}); 

dies ist ein Teil von gulpfile.ts

+0

verwenden entfernen Sie einfach den Code für browserSync einfach? verwendest du angular2 CLI? –

+0

Können Sie weitere Informationen hinzufügen? Wo benutzt du es? Versionen, Projektstruktur ... [Erstellen eines minimalen, vollständigen und überprüfbaren Beispiels] (http://stackoverflow.com/help/mcve) – Sasxa

+0

Ich bin neu darin. Was bedeutet CLI? weee diesen Code zu entfernen. Sagen Sie die Wahrheit Ich habe jede Schluckdatei durchsucht, aber keine BrowserSync-Variable in Ordnung gebracht – Serhiy

Antwort

0

Wenn Sie Angular2-Seed-Projekt dann werfen Sie einen Blick in seed.config.ts

/** 
     * Configurations for NPM module configurations. Add to or override in project.config.ts. 
     * If you like, use the mergeObject() method to assist with this. 
     */ 
     PLUGIN_CONFIGS: any = { 
     /** 
     * The BrowserSync configuration of the application. 
     * The default open behavior is to open the browser. To prevent the browser from opening use the `--b` flag when 
     * running `npm start` (tested with serve.dev). 
     * Example: `npm start -- --b` 
     * @type {any} 
     */ 
     'browser-sync': { 
      middleware: [require('connect-history-api-fallback')({ index: `${this.APP_BASE}index.html` })], 
      port: this.PORT, 
      startPath: this.APP_BASE, 
      open: argv['b'] ? false : true, 
      injectChanges: false, 
      server: { 
      baseDir: `${this.DIST_DIR}/empty/`, 
      routes: { 
       [`${this.APP_BASE}${this.APP_DEST}`]: this.APP_DEST, 
       [`${this.APP_BASE}node_modules`]: 'node_modules', 
       [`${this.APP_BASE.replace(/\/$/, '')}`]: this.APP_DEST 
      } 
      } 
     } 
     }; 
+0

kann es nicht fin. Ich glaube nicht, dass ich es benutze. Ich habe Version geschrieben – Serhiy

Verwandte Themen