visual studio 2015 - BrowserSync not refreshing my VS2015 with IIS Express? -
i trying use browsersync vs2015. here's have far:
/// <binding beforebuild='scripts, less, css' projectopened='watch' /> "use strict"; var browsersync = require('browser-sync'); var concat = require('gulp-concat'); var del = require('del'); var gulp = require('gulp'); var gzip = require('gulp-gzip'); var less = require('gulp-less'); var minifycss = require('gulp-minify-css'); var reload = browsersync.reload; var uglify = require('gulp-uglify'); var cssconfig = { src: [ 'wwwroot/content/less/normalize.css', 'wwwroot/content/less/alert.css', 'wwwroot/content/less/auth.css', 'wwwroot/content/less/body.css', 'wwwroot/content/less/breadcrumb.css', 'wwwroot/content/less/button-groups.css', 'wwwroot/content/less/button.css', 'wwwroot/content/less/carousel.css', 'wwwroot/content/less/checkbox.css', 'wwwroot/content/less/content.css', 'wwwroot/content/less/dropdowns.css', 'wwwroot/content/less/font-awesome.css', 'wwwroot/content/less/fonts.css', 'wwwroot/content/less/form.css', 'wwwroot/content/less/generic.css', 'wwwroot/content/less/grid-user.css', 'wwwroot/content/less/grid.css', 'wwwroot/content/less/header.css', 'wwwroot/content/less/home.css', 'wwwroot/content/less/html-dark.css', 'wwwroot/content/less/html-light-user.css', 'wwwroot/content/less/html-light.css', 'wwwroot/content/less/html-user.css', 'wwwroot/content/less/html.css', 'wwwroot/content/less/loading-bar.css', 'wwwroot/content/less/media-breadcrumb.css', 'wwwroot/content/less/media-grid.css', 'wwwroot/content/less/media-gridinfo.css', 'wwwroot/content/less/media-header.css', 'wwwroot/content/less/media-question.css', 'wwwroot/content/less/media.css', 'wwwroot/content/less/modal.css', 'wwwroot/content/less/pagedown.css', 'wwwroot/content/less/print.css', 'wwwroot/content/less/question.css', 'wwwroot/content/less/tabs.css', 'wwwroot/content/less/wmd.css', ], } var jsconfig = { src: [ 'wwwroot/lib/pagedown/markdown.converter.js', 'wwwroot/lib/pagedown/markdown.sanitizer.js', 'wwwroot/lib/pagedown/markdown.editor.js', 'wwwroot/lib/angular/angular.js', 'wwwroot/lib/angular-cookies/angular-cookies.js', 'wwwroot/lib/angular-loading-bar/build/loading-bar.min.js', 'wwwroot/lib/angular-translate/angular-translate.js', 'wwwroot/lib/angular-translate-loader-static-files/angular-translate-loader-static-files.js', 'wwwroot/lib/angular-translate-storage-cookie/angular-translate-storage-cookie.js', 'wwwroot/lib/angular-translate-storage-local/angular-translate-storage-local.js', 'wwwroot/lib/angular-ui-router/release/angular-ui-router.js', 'wwwroot/lib/angular-bootstrap/ui-bootstrap-tpls.js', 'wwwroot/app/controllers/modalinstance.js', 'wwwroot/app/services/alertservice.js', 'wwwroot/app/services/authservice.js', 'wwwroot/app/services/errorservice.js', 'wwwroot/app/services/examservice.js', 'wwwroot/app/services/questionservice.js', 'wwwroot/app/services/stateservice.js', 'wwwroot/app/services/subjectservice.js', 'wwwroot/app/services/testservice.js', 'wwwroot/app/services/userservice.js', 'wwwroot/app/access/controllers/webapicontroller.js', 'wwwroot/app/access/access.js', 'wwwroot/app/auth/auth.js', 'wwwroot/app/exams/controllers/examscontroller.js', 'wwwroot/app/exams/exam.js', 'wwwroot/app/questions/controllers/questionscontroller.js', 'wwwroot/app/questions/question.js', 'wwwroot/app/tests/controllers/deletetestcontroller.js', 'wwwroot/app/tests/controllers/marktestcontroller.js', 'wwwroot/app/tests/controllers/refreshtestcontroller.js', 'wwwroot/app/tests/controllers/testscontroller.js', 'wwwroot/app/tests/test.js', 'wwwroot/app/appconfig.js', 'wwwroot/app/appcontroller.js', 'wwwroot/app/apprun.js', 'wwwroot/app/app.js', 'wwwroot/app/directives/dropdown.js', 'wwwroot/app/directives/dropdownlink.js', 'wwwroot/app/directives/pagedownpreview.js', 'wwwroot/app/directives/pagedownadmin.js', 'wwwroot/app/filters/range.js', 'wwwroot/app/filters/sdate.js', 'wwwroot/app/filters/truncate.js', ], } var gzip_options = { threshold: '1kb', gzipoptions: { level: 9 } }; gulp.task('browser-sync', function () { var files = [ 'wwwroot/content/**/*/.html', 'wwwroot/content/less/html.css' ]; browsersync.init(files, { server: { basedir: "./" } }); }); gulp.task('clean-css', function () { del.sync(['wwwroot/content/bundles/css.min.css']) }); gulp.task('clean-js', function () { del.sync(['wwwroot/content/bundles/js.min.js']) }); gulp.task('default', ['browser-sync'], function () { gulp.watch('wwwroot/content/less/*.less', ['less']); gulp.watch('wwwroot/content/less/*.css', reload); }); gulp.task('less', function () { gulp.src('wwwroot/content/less/*.less') .pipe(less()) .pipe(gulp.dest('wwwroot/content/less')); }); gulp.task('scripts', ['clean-js'], function () { return gulp.src(jsconfig.src) .pipe(uglify()) .pipe(concat('js.min.js')) .pipe(gulp.dest('wwwroot/content/bundles/')) .pipe(gzip(gzip_options)) .pipe(gulp.dest('wwwroot/content/bundles/')); }); gulp.task('css', ['clean-css'], function () { return gulp.src(cssconfig.src) .pipe(minifycss()) .pipe(concat('css.min.css')) .pipe(gulp.dest('wwwroot/content/bundles/')) .pipe(gzip(gzip_options)) .pipe(gulp.dest('wwwroot/content/bundles/')); });
when run default output:
[bs] access urls: ---------------------------------------- local: http://localhost:3000 external: http://192.168.243.139:3000 ---------------------------------------- ui: http://localhost:3001 ui external: http://192.168.243.139:3001 ---------------------------------------- [bs] serving files from: ./ [bs] watching files...
when html.less file changed see tries refresh:
[bs] reloading browsers... [bs] file changed: wwwroot/content/less/html.css [bs] reloading browsers... [bs] reloading browsers...
but nothing changes on browser , don't see refresh happen.
can experience of point me in right direction?
thanks
browsersync.init(files, { server: { basedir: "./" } }); instead of option use other
browsersync.init({ proxy: "[**it_is_the_url_which_visiulstudio_does**]", files: [ 'wwwroot/content/**/*/.html', 'wwwroot/content/less/html.css' ] });
Comments
Post a Comment