Skip to content

Commit

Permalink
refactor: add livereload arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
crimx committed Jul 8, 2020
1 parent 78b3926 commit 13b0fd6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
3 changes: 3 additions & 0 deletions README.md
Expand Up @@ -276,6 +276,9 @@ yarn build --livereload

# specify browser application
yarn build --livereload=firefox

# with arguments
yarn build --livereload=google-chrome --livereloadargs='--profile-directory=Profile 1'
```

Behind the scene whenever webpack finishes bundling, it opens a special url in the browser running the extension. The url is then captured by the injected script which notifies the extension to reload itself.
Expand Down
6 changes: 5 additions & 1 deletion lib/WexExtManifestPlugin.js
Expand Up @@ -163,9 +163,13 @@ class WexExtManifestPlugin {

if (argv.livereload) {
if (typeof argv.livereload === 'string') {
const app = [argv.livereload]
if (argv.livereloadargs) {
app.push(argv.livereloadargs)
}
await open(
'http://neutrino-webextension.reloads',
{ app: argv.livereload, background: true }
{ app, background: true }
)
} else {
await open(
Expand Down

0 comments on commit 13b0fd6

Please sign in to comment.