0.1.12 • Published 7 years ago

@devcode/browser-sync v0.1.12

Weekly downloads
1
License
MIT
Repository
github
Last release
7 years ago

DevCode BrowserSync

DevCode plugin which serves for development purposes.

Getting started

Prerequisites

What things you need:

How to install

Install it as devDependency:

npm install -D @devcode/browser-sync

How to use

Include it in gulpfile.js:

const gulp = require('gulp')
const plugins = {
  browserSync: require('@devcode/browser-sync')
}
const env = process.argv.includes('build') ? 'production' : 'development'
const config = require('./config.js')

const watcher = plugins.browserSync(config, env)

gulp.task('watch', () => {
  watcher()
})

If you use @devcode/init then you can use it like this:

const gulp = require('gulp')
const init = require('@devcode/init')
const plugins = {
  browserSync: require('@devcode/browser-sync')
}
const env = process.argv.includes('build') ? 'production' : 'development'

init({
  gulp,
  env,
  plugins: {
    reload: [plugins.browserSync],
    ...
  }
})

API

const pluginBrowserSync = require('@devcode/browser-sync') 
// => function (config: object, env: string)

The required package returns function which needs configuration (object) and environment variable which accepts string: development or production.

When you call this function it returns watcher (function) which you can call when you want to watch files changes.

Configuration

Options to pass to BrowserSync

module.exports = {
  browserSync: {
    // options related to the BrowserSync
  }
}

Built with

  • Gulp - The streaming build system
  • BrowserSync - Live CSS Reload & Browser Syncing

Contributing

Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us.

Versioning

We use SemVer for versioning.

Authors

See also the list of contributors who participated in this project.

License

This project is licensed under the MIT License - see the LICENSE.md file for details.

Acknowledgements

  • This project was inspired by Blendid
0.1.12

7 years ago

0.1.11

7 years ago

0.1.10

7 years ago

0.1.9

7 years ago

0.1.8

7 years ago

0.1.7

7 years ago

0.1.6

7 years ago

0.1.5

7 years ago

0.1.4

7 years ago

0.1.1

7 years ago