https://github.com/jamen/rollup-plugin-browser-extension
https://github.com/jamen/rollup-plugin-browser-extension
Last synced: 12 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/jamen/rollup-plugin-browser-extension
- Owner: jamen
- Created: 2019-05-20T20:58:11.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2019-05-26T03:35:57.000Z (about 7 years ago)
- Last Synced: 2025-06-05T19:05:48.817Z (about 1 year ago)
- Language: JavaScript
- Homepage:
- Size: 3.91 KB
- Stars: 1
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
# rollup-plugin-browser-extension
Rollup plugin for browser extensions.
## Usage
Add the plugin to your Rollup config
```js
import extension from 'rollup-plugin-browser-extension'
export default {
// ...
plugins: [
extension()
]
}
```
The plugin makes a `'browser'` module available, which exports APIs from [`chrome`](https://developer.chrome.com/extensions/api_index) and [`browser`](https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API). It also exports `browser` for any APIs [not added yet](./src/browser-extension.js).
```js
import { browser, runtime, tabs } from 'browser'
runtime.onMessage.addListener(() => {
// ...
})
```