{"action":"created","issue":{"url":"https://api.github.com/repos/Va1/browser-sync-webpack-plugin/issues/4","labels_url":"https://api.github.com/repos/Va1/browser-sync-webpack-plugin/issues/4/labels{/name}","comments_url":"https://api.github.com/repos/Va1/browser-sync-webpack-plugin/issues/4/comments","events_url":"https://api.github.com/repos/Va1/browser-sync-webpack-plugin/issues/4/events","html_url":"https://github.com/Va1/browser-sync-webpack-plugin/issues/4","id":101872246,"number":4,"title":"CSS injecting doesn't work, the page just reloads","user":{"login":"web2style","id":2179726,"avatar_url":"https://avatars.githubusercontent.com/u/2179726?v=3","gravatar_id":"","url":"https://api.github.com/users/web2style","html_url":"https://github.com/web2style","followers_url":"https://api.github.com/users/web2style/followers","following_url":"https://api.github.com/users/web2style/following{/other_user}","gists_url":"https://api.github.com/users/web2style/gists{/gist_id}","starred_url":"https://api.github.com/users/web2style/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/web2style/subscriptions","organizations_url":"https://api.github.com/users/web2style/orgs","repos_url":"https://api.github.com/users/web2style/repos","events_url":"https://api.github.com/users/web2style/events{/privacy}","received_events_url":"https://api.github.com/users/web2style/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":23,"created_at":"2015-08-19T11:41:41Z","updated_at":"2015-09-30T13:54:17Z","closed_at":null,"body":"Here is my gulpfile:\r\n\r\n```\r\nimport gulp from 'gulp';\r\nimport gulpLoadPlugins from 'gulp-load-plugins';\r\nimport del from 'del';\r\nimport source from 'vinyl-source-stream';\r\nimport runSequence from 'run-sequence';\r\nimport {reload} from 'browser-sync';\r\nimport historyApiFallback from 'connect-history-api-fallback';\r\nimport webpack from 'webpack-stream';\r\nimport BrowserSyncPlugin from 'browser-sync-webpack-plugin';\r\n\r\nconst AUTOPREFIXER_BROWSERS = [\r\n  'ie >= 10',\r\n  'ie_mob >= 10',\r\n  'ff >= 30',\r\n  'chrome >= 34',\r\n  'safari >= 7',\r\n  'opera >= 23',\r\n  'ios >= 7',\r\n  'android >= 4.4',\r\n  'bb >= 10'\r\n];\r\n\r\nconst $ = gulpLoadPlugins()\r\n  , env = 'dev';\r\n\r\nglobal.isWatching = false;\r\n\r\ngulp.task('clean:dev', del.bind(null, ['.tmp'], {dot: true}));\r\ngulp.task('clean:dist', del.bind(null, ['dist'], {dot: true}));\r\n\r\ngulp.task('webpack', () => {\r\n  return gulp.src('./app/scripts/app.jsx')\r\n    .pipe(webpack({\r\n      node: {\r\n        net: \"empty\",\r\n        dns: \"empty\"\r\n      },\r\n      debug: true,\r\n      devtool: 'source-map',\r\n      watch: true,\r\n      module: {\r\n        loaders: [\r\n          { test: /\\.jsx?$/, loader: 'babel-loader?stage=0', exclude: /node_modules/ }\r\n        ]\r\n      },\r\n      output: {\r\n        filename: \"bundle.js\"\r\n      },\r\n      resolve: {\r\n        modulesDirectories: [\r\n          'node_modules',\r\n          'app/scripts'\r\n        ],\r\n        extensions: [ \"\", '.js', '.jsx' ]\r\n      },\r\n      plugins: [\r\n        new BrowserSyncPlugin({\r\n          port: 8000,\r\n          open: false,\r\n          minify: false,\r\n          host: \"127.0.0.1\",\r\n          server: {\r\n            baseDir: [\"app\", \".tmp\"],\r\n            middleware: [ historyApiFallback() ]\r\n          }\r\n        })\r\n      ]\r\n    }))\r\n    .pipe(gulp.dest('.tmp/scripts/'))\r\n    .pipe(reload({stream: true}));\r\n});\r\n\r\ngulp.task('imagemin', () => {\r\n  return gulp.src('app/images/*')\r\n    .pipe($.imagemin({\r\n            progressive: true,\r\n            svgoPlugins: [{removeViewBox: false}]\r\n    }))\r\n    .pipe(gulp.dest('dist/images'));\r\n});\r\n\r\ngulp.task('copy', () => {\r\n  return gulp.src(['app/*.txt', 'app/*.ico'])\r\n    .pipe(gulp.dest('dist'));\r\n});\r\n\r\ngulp.task('bundle', ['webpack'], () => {\r\n  const assets = $.useref.assets();\r\n  const jsFilter = $.filter(['**/*.js']);\r\n  const htmlFilter = $.filter(['*.html']);\r\n\r\n  return gulp.src('app/*.html')\r\n    .pipe(assets)\r\n    .pipe($.rev())\r\n    .pipe(jsFilter)\r\n    .pipe($.uglify({mangle: false}))\r\n    .pipe(jsFilter.restore())\r\n    .pipe(cssFilter)\r\n    .pipe($.autoprefixer({\r\n      browsers: ['last 5 versions']\r\n    }))\r\n    .pipe(cssFilter.restore())\r\n    .pipe(assets.restore())\r\n    .pipe($.useref())\r\n    .pipe($.revReplace())\r\n    .pipe(gulp.dest('dist'))\r\n    .pipe($.size());\r\n});\r\n\r\ngulp.task('sass', () => {\r\n  return gulp.src([\r\n    'app/scss/all.scss'\r\n  ])\r\n    .pipe($.sourcemaps.init())\r\n    .pipe($.sass({\r\n      precision: 10\r\n    }).on('error', $.sass.logError))\r\n    .pipe($.cssInlineImages({\r\n      webRoot: 'app/scss/mdl/'\r\n    }))\r\n    .pipe($.autoprefixer(AUTOPREFIXER_BROWSERS))\r\n    //.pipe($.if('*.css', $.csso()))\r\n    //.pipe($.concat('all.min.css'))\r\n    .pipe($.sourcemaps.write('./'))\r\n    .pipe(gulp.dest('.tmp/css'))\r\n    .pipe(reload({stream: true}))\r\n    .pipe($.size({title: 'styles'}));\r\n});\r\n\r\ngulp.task('setWatch', () => {\r\n  global.isWatching = true;\r\n});\r\n\r\ngulp.task('watch', ['setWatch'], () => {\r\n  gulp.watch(\"app/scss/**/*.scss\", ['sass']);\r\n  gulp.watch(['app/*.html'], reload);\r\n});\r\n\r\ngulp.task('csscomb', function() {\r\n  return gulp.src('app/scss/app.scss')\r\n    .pipe($.csscomb())\r\n    .pipe(gulp.dest('app/scss'))\r\n});\r\n\r\ngulp.task('serve', ['clean:dev'], () => {\r\n  runSequence(\r\n    ['webpack', 'watch', 'sass']\r\n  )\r\n});\r\n\r\ngulp.task('build', ['clean:dev', 'clean:dist'], () => {\r\n  runSequence(\r\n    ['webpack', 'imagemin', 'copy', 'bundle']\r\n  )\r\n});\r\n\r\ngulp.task('default', ['serve']);\r\n```\r\n\r\nBrowsersync starts, but it doesn't inject CSS, the page just reloads.\r\n\r\nDid I do smth wrong?"},"comment":{"url":"https://api.github.com/repos/Va1/browser-sync-webpack-plugin/issues/comments/144410344","html_url":"https://github.com/Va1/browser-sync-webpack-plugin/issues/4#issuecomment-144410344","issue_url":"https://api.github.com/repos/Va1/browser-sync-webpack-plugin/issues/4","id":144410344,"user":{"login":"DLMR","id":2854610,"avatar_url":"https://avatars.githubusercontent.com/u/2854610?v=3","gravatar_id":"","url":"https://api.github.com/users/DLMR","html_url":"https://github.com/DLMR","followers_url":"https://api.github.com/users/DLMR/followers","following_url":"https://api.github.com/users/DLMR/following{/other_user}","gists_url":"https://api.github.com/users/DLMR/gists{/gist_id}","starred_url":"https://api.github.com/users/DLMR/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DLMR/subscriptions","organizations_url":"https://api.github.com/users/DLMR/orgs","repos_url":"https://api.github.com/users/DLMR/repos","events_url":"https://api.github.com/users/DLMR/events{/privacy}","received_events_url":"https://api.github.com/users/DLMR/received_events","type":"User","site_admin":false},"created_at":"2015-09-30T13:54:17Z","updated_at":"2015-09-30T13:54:17Z","body":"@web2style Yes, it works fine and I'm using 3000 for BrowserSync. \r\n````javascript\r\nnew BrowserSyncPlugin({\r\n  host: 'localhost',\r\n  port: 3000,\r\n  logFileChanges: false\r\n}, {\r\n  reload: false\r\n});\r\n````\r\nHowever BrowserSync starts on port 3002 with the GUI at 3003 and Koa runs on 3000 with Webpack Dev Server runs on 3001. A bit strange that I'm not getting the same error as you... \r\n\r\nIf it still does not work for you I can take another look at it, sorry for the late reply."}}