All Projects → Va1 → Browser Sync Webpack Plugin

Va1 / Browser Sync Webpack Plugin

Licence: mit
Easily use BrowserSync in your Webpack project.

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Browser Sync Webpack Plugin

Multipage Webpack Plugin
A plugin that makes handling templates and asset distribution for multi-page applications using webpack trivial
Stars: ✭ 168 (-52.81%)
Mutual labels:  webpack, webpack2, webpack-plugin
Webpack Core Usage
webpack2完整系列课程,欢迎阅读。同时欢迎移步我的react全家桶文章全集: https://github.com/liangklfangl/react-article-bucket
Stars: ✭ 94 (-73.6%)
Mutual labels:  webpack, webpack2, webpack-plugin
Webpack Alioss Plugin
阿里 oss-webpack 自动上传插件
Stars: ✭ 35 (-90.17%)
Mutual labels:  webpack, webpack2, webpack-plugin
Svg Sprite Loader
Webpack loader for creating SVG sprites.
Stars: ✭ 1,822 (+411.8%)
Mutual labels:  webpack, webpack2, webpack-plugin
Webpack Cdn Plugin
A webpack plugin that use externals of CDN urls for production and local node_modules for development
Stars: ✭ 306 (-14.04%)
Mutual labels:  webpack, webpack2, webpack-plugin
Kirby Webpack
💪 A Kirby CMS starter-kit with modern frontend tools
Stars: ✭ 150 (-57.87%)
Mutual labels:  webpack, livereload, browsersync
Everything Is A Plugin
Everything is a Plugin: Mastering webpack from the inside out. NgConf 2017
Stars: ✭ 123 (-65.45%)
Mutual labels:  webpack, webpack2, webpack-plugin
Webpack.js.org
Repository for webpack documentation and more!
Stars: ✭ 2,049 (+475.56%)
Mutual labels:  webpack, webpack2, webpack-plugin
Html Res Webpack Plugin
plugin for generating html in webpack
Stars: ✭ 170 (-52.25%)
Mutual labels:  webpack, webpack2, webpack-plugin
magento-2-gulp
Gulp for Magento 2. It works with core Magento styles (less) and structure. Uses default theme configs from dev/tools/grunt/configs/local-themes.js.
Stars: ✭ 37 (-89.61%)
Mutual labels:  browsersync, livereload
bower-resolve-webpack-plugin
Offers an enhanced bower support for enhanced-resolve plugin.
Stars: ✭ 12 (-96.63%)
Mutual labels:  webpack-plugin, webpack2
tde-webpack-mjml-plugin
Webpack plugin for converting MJML files to HTML
Stars: ✭ 12 (-96.63%)
Mutual labels:  webpack-plugin, webpack2
Webpack Shell Plugin
Run shell commands either before or after webpack builds
Stars: ✭ 250 (-29.78%)
Mutual labels:  webpack, webpack-plugin
Suddi.github.io
A static single-page application resume-builder developed using React.js and JSON Resume schema (https://suddi.io/)
Stars: ✭ 246 (-30.9%)
Mutual labels:  webpack, webpack2
prettier-eslint-webpack-plugin
Webpack plugin for prettier-eslint which ESLint's settings is set to JavaScript Standard Style
Stars: ✭ 24 (-93.26%)
Mutual labels:  webpack-plugin, webpack2
Webpack Messages
Beautifully format Webpack messages throughout your bundle lifecycle(s)!
Stars: ✭ 238 (-33.15%)
Mutual labels:  webpack, webpack-plugin
Webpack Assets Manifest
This Webpack plugin will generate a JSON file that matches the original filename with the hashed version.
Stars: ✭ 269 (-24.44%)
Mutual labels:  webpack, webpack-plugin
Webpack Virtual Modules
Webpack Virtual Modules is a webpack plugin that lets you create, modify, and delete in-memory files in a way that webpack treats them as if they were physically presented in the file system.
Stars: ✭ 286 (-19.66%)
Mutual labels:  webpack, webpack-plugin
Copy Webpack Plugin
Copy files and directories with webpack
Stars: ✭ 2,679 (+652.53%)
Mutual labels:  webpack, webpack-plugin
ignore-emit-webpack-plugin
Prevents ignored files from being emitted during a Webpack build
Stars: ✭ 17 (-95.22%)
Mutual labels:  webpack-plugin, webpack2

BrowserSync plugin for Webpack

Easily use BrowserSync in your Webpack project.

Install:

$ npm install --save-dev browser-sync-webpack-plugin

or

$ yarn add --dev browser-sync-webpack-plugin

With release of 2.0.0 the plugin is expected to be used in Node v4+ environment. Support for Node v3 and lower was dropped, but you can install and use the plugin version of 1.2.0 in older environments.

Usage:

BrowserSync will start only when you run Webpack in watch mode:

$ webpack --watch

Basic:

If you're not using Webpack Dev Server, you can make BrowserSync to serve your project. The setup is pretty easy: just pass the BrowserSync options to the plugin as the first argument.

In your webpack.config.js:

const BrowserSyncPlugin = require('browser-sync-webpack-plugin')

module.exports = {
  // ...
  plugins: [
    new BrowserSyncPlugin({
      // browse to http://localhost:3000/ during development,
      // ./public directory is being served
      host: 'localhost',
      port: 3000,
      server: { baseDir: ['public'] }
    })
  ]
}

Advanced:

The advanced usage is about using Webpack Dev Server with BrowserSync in order to use awesome features of both.

To achieve this, BrowserSync offers the proxy option. So, basically, you are about to proxy the output from the Webpack Dev Server through BrowserSync to get the best out of both.

In your webpack.config.js:

const BrowserSyncPlugin = require('browser-sync-webpack-plugin')

module.exports = {
  // ...
  plugins: [
    new BrowserSyncPlugin(
      // BrowserSync options
      {
        // browse to http://localhost:3000/ during development
        host: 'localhost',
        port: 3000,
        // proxy the Webpack Dev Server endpoint
        // (which should be serving on http://localhost:3100/)
        // through BrowserSync
        proxy: 'http://localhost:3100/'
      },
      // plugin options
      {
        // prevent BrowserSync from reloading the page
        // and let Webpack Dev Server take care of this
        reload: false
      }
    )
  ]
}

Other supported plugin options are:

  • name - default: bs-webpack-plugin, BrowserSync instance name
  • callback - default: undefined, BrowserSync instance init callback.
  • injectCss - default: false, allows BrowserSync to inject changes inplace instead of reloading the page when changed chunks are all CSS files

Contributing:

Feel free to open issues to propose stuff and participate. Pull requests are also welcome.

Licence:

MIT

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].