Package Exports
- webpack-run-chrome-extension
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (webpack-run-chrome-extension) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
webpack-run-chrome-extension


Build your extension on Chrome with auto-reload support
Opens up a new Chrome instance with an extension loaded. The browser instance accepts all flags Chrome does (see browserFlags) and loads on a clean profile by default. The extension loaded includes default live-reload support.
Highlights
- Zero-config live-reload. The plugin reloads background pages, content scripts, options pages. Everything. (customizable)
- Fresh profile on every run. Preserve your main profile by using discardable profiles for development (customizable).
- No need to download Chrome. Uses the system installed Chrome binary (accepts Canary builds).
- No hanging processes or extra steps to open/close Chrome. Killing the dev server instance kills all opened plugin processes.
- Supports virtually all Chrome flags.
yarn add webpack-chrome-extension-launcher -D
Usage
yarn add webpack-run-chrome-extension -D
If you want to watch for file changes in your extension, watch
mode must be enabled.
// webpack config file
+ const WebpackRunChromeExtension = require('webpack-run-chrome-extension')
module.exports {
+ watch: true,
plugins: [
+ new WebpackRunChromeExtension({
+ extensionPath: 'path/to/extension'
+ })
]
}
Lazy sample
const WebpackRunChromeExtension = require('webpack-run-chrome-extension')
new WebpackRunChromeExtension({
extensionPath: 'path/to/extension/dir', // Only required field
browserFlags: [
'--enable-experimental-extension-apis',
'--embedded-extension-options'
],
userDataDir: 'path/to/user/data/dir',
startingUrl: 'https://example.com',
autoReload: true,
port: 8081
})
API
new WebpackRunChromeExtension(options)
Options
extensionPath (required)
Type: string
Path to your extension. Must point to the same directory as the manifest file.
browserFlags (optional)
Type: Array<string>
Additional flags to pass to Chrome. Defaults to these flags.
For a full list of available flags, see https://peter.sh/experiments/chromium-command-line-switches/.
userDataDir (optional)
Type: string
| boolean
What Chrome profile path to use. A boolean value of false
sets the profile to the default user profile. Defaults to a fresh Chrome profile.
startingUrl (optional)
Type: string
What URL to start the browser with. Defaults to about:blank
autoReload (optional)
Type: boolean
Whether to enable auto-reload on save. Defaults to true
port (optional)
Type: number
What port should run the extension reloader. Defaults to 8080
License
MIT (c) Cezar Augusto.