rushstack
rushstack copied to clipboard
[heft-browsersync-plugin] Adds implementation of heft-browsersync-plugin
Summary
Added an initial implementation of a browsersync plugin for heft.
Details
Browsersync provides a capable test/dev webserver, supporting live reload, form replication and click mirroring, making it very useful for cross browser development. It can also just be used as a basic web dev server.
This has been setup as a postBuild stage task with a check for serveMode being true.
Configuration file looks something like this:
{
"$schema": "../../../node_modules/@diwi/heft-browsersync-plugin/schemas/browsersync.schema.json",
"rootDir": "./dist/",
"port": 8000,
"watch": true
}
I have only exposed the most basic configuration options at this time. I think further options for https configuration may well be required.
How it was tested
Currently this has been manually tested through publishing on an internal npm repository and then having a rig project use the above config. I will likely follow up with another PR for some other plugins and can then link to a public repo for the rig project that I'm using right now.
Note: PR #3337 has renamed our GitHub master branch to main. This should not affect your pull request, but we recommend to redo your git clone to avoid confusion with the old branch name.