Go to file
2023-09-05 15:45:25 -04:00
.vscode add vs code extension config for dprint 2023-09-05 15:45:25 -04:00
src Move things to src 2023-09-05 15:41:43 -04:00
.git-blame-ignore-revs add previous commit to blame ignore revs 2023-08-14 14:08:21 -04:00
.gitignore ignore that 2023-07-28 07:59:57 -04:00
dprint.json add dprint for formatting 2023-08-14 14:07:25 -04:00
package-lock.json finish setting up dev dependencies properly 2023-08-14 14:37:55 -04:00
package.json finish setting up dev dependencies properly 2023-08-14 14:37:55 -04:00
README.md npm run fmt 2023-08-14 14:07:31 -04:00
rollup.config.js Move things to src 2023-09-05 15:41:43 -04:00
tsconfig.json bunch of tweaks to get TS working 2023-07-28 07:48:01 -04:00

rollup-build-webext-config

Simplify Rollup configuration for browser extensions by pulling script entry points and other asset paths straight from your manifest.json. Recognizes manifest versions 2 and 3.

Usage

Targeting a single platform

// rollup.config.js
import {buildConfig} from 'rollup-build-webext-config';

import commonjs from '@rollup/plugin-commonjs';
import {nodeResolve} from '@rollup/plugin-node-resolve';

export default buildConfig({
	manifest: 'path/to/your/manifest.json',
	outDir: 'build',
	sourcemap: 'inline',
	plugins: [
		nodeResolve(),
		commonjs(),
	],
});

Targeting multiple platforms

// rollup.config.js
import {buildConfig} from 'rollup-build-webext-config';

export default ['chromium', 'firefox'].flatMap(platform =>
	buildConfig({
		manifest: `manifest-${platform}.json`,
		outDir: `build/${platform}`,
		// ...
	})
);