https://github.com/rinti/webpack-browser-sync-inject-plugin
Auto inject css with browse sync and webpack
https://github.com/rinti/webpack-browser-sync-inject-plugin
browser-sync browsersync plugin webpack
Last synced: about 1 month ago
JSON representation
Auto inject css with browse sync and webpack
- Host: GitHub
- URL: https://github.com/rinti/webpack-browser-sync-inject-plugin
- Owner: rinti
- Created: 2017-10-29T12:59:16.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2017-11-01T13:07:49.000Z (over 8 years ago)
- Last Synced: 2025-10-22T02:58:10.356Z (8 months ago)
- Topics: browser-sync, browsersync, plugin, webpack
- Language: JavaScript
- Size: 35.2 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Webpack Browser Sync Inject Plugin
There's already the excellent, more mature [browser-sync-webpack-plugin](https://github.com/Va1/browser-sync-webpack-plugin).
That plugin does however default to always reloading the browser - and that's
suboptimal when working with stylesheets. There's a pending PR to fix this.
In the meantime this plugin might save your day!
At the moment this plugin is pretty specialized for my use case, if you
want to make it more generalized, PR:s are welcome!
## Install
```bash
npm install --save-dev webpack-browser-sync-inject-plugin
```
## Example usage
First argument to the plugin is reserved for this plugins options,
Second argument is options to pass to browser sync.
```js
new BrowserSyncInjectPlugin({
watchForInjection: ['style'] // style is a defined in your webpack config
}, {
host: 'localhost',
port: 3000,
proxy: 'http://mysite.dev:8085/'
})
```