MCPcopy
hub / github.com/crxjs/chrome-extension-tools

github.com/crxjs/chrome-extension-tools @v4.0.1-12 sqlite

repository ↗ · DeepWiki ↗ · release v4.0.1-12 ↗
306 symbols 1,448 edges 406 files 0 documented · 0%
README

rollup-plugin-chrome-extension

npm (scoped) GitHub last commit GitHub action badge TypeScript Declarations Included

rollup-plugin-chrome-extension logo

The bundler configuration for a Chrome Extension can be pretty complex. This plugin makes it simple.

Use manifest.json as the input. Every file in the manifest will be bundled or copied to the output folder.

RPCE simplifies project config and supports many of Vite's features in the Chrome Extension environment, including HMR.

Vite Usage

Vite support is in beta! Check out this 90 second getting started guide.

npm i rollup-plugin-chrome-extension@beta -D
// vite.config.js

import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
import { chromeExtension } from 'rollup-plugin-chrome-extension'

export default defineConfig({
  plugins: [react(), chromeExtension()],
})

Just add new features to your manifest, and RPCE does the rest.

Documentation for v3

We have v3 boilerplates for React JavaScript, React TypeScript and Svelte, as well as instructions for setting up your project.

See the documentation for usage and how to get started.

Contributing

Your help is super welcome!

🎯 Ongoing development is for v4+ only.

👀 Be sure to take a look at the issues before starting to work on a new feature.

🙏 Please update the tests to cover bug fixes or new features.

📕 Documentation for v4 has not yet begun, but you can open an issue for help.

✨ If you enjoy using RPCE, please help spread the word!

Development

Our preferred package manager is pnpm, but npm or Yarn should work.

If you're using VSCode, you can run the default build task (Ctrl+Shift+B or ⇧⌘B for Mac) to start building and type checking.

Extension points exported contracts — how you extend this code

ImportMetaEnv (Interface)
(no doc)
test/env.d.ts
InversePromise (Interface)
(no doc)
test/helpers/inversePromise.ts
FilesContext (Interface)
(no doc)
src/files.machine.ts
FileWriterContext (Interface)
(no doc)
src/plugin-viteServeFileWriter.machine.ts
UseMachineOptions (Interface)
(no doc)
src/xstate_helpers.ts
AcornLiteral (Interface)
(no doc)
src/plugin-viteServeReactFastRefresh_MV2.ts
Script (Interface)
(no doc)
src/types.ts
ImportMeta (Interface)
(no doc)
test/env.d.ts

Core symbols most depended-on inside this repo

byFileName
called by 215
test/helpers/utils.ts
chromeExtension
called by 68
src/index.ts
jestSetTimeout
called by 63
test/helpers/timeout.ts
get
called by 24
src/plugin-viteServeHMR_MV3.ts
getRollupOutput
called by 22
test/helpers/getRollupOutput.ts
filesReady
called by 22
src/plugin-viteServeFileWriter.ts
stopFileWriter
called by 22
src/plugin-viteServeFileWriter.ts
narrowEvent
called by 15
src/xstate_helpers.ts

Shape

Function 287
Interface 16
Class 2
Method 1

Languages

TypeScript100%

Modules by API surface

src/plugin-autoPerms_permTests.ts46 symbols
src/index.ts16 symbols
src/helpers.ts14 symbols
src/types.ts11 symbols
src/plugin-viteServeFileWriter.ts11 symbols
src/plugin-transformIndexHtml.ts11 symbols
src/files_htmlParser.ts11 symbols
src/plugin-viteServeHMR_MV3.ts10 symbols
src/plugin-viteServeReactFastRefresh_MV2.ts8 symbols
src/plugin-hybridOutput.ts8 symbols
src/plugin_helpers.ts7 symbols
src/plugin-viteServeReactFastRefresh_MV3.ts7 symbols

Dependencies from manifests, versioned

@extend-chrome/messages1.2.2 · 1×
@extend-chrome/storage1.5.0 · 1×
@rollup/plugin-alias3.1.8 · 1×
@rollup/plugin-commonjs21.0.1 · 1×
@rollup/plugin-json4.1.0 · 1×
@rollup/plugin-node-resolve13.1.1 · 1×
@rollup/pluginutils4.1.1 · 1×
@testing-library/dom8.11.1 · 1×
@testing-library/jest-dom5.16.1 · 1×
@types/acorn4.0.6 · 1×
@types/chrome0.0.176 · 1×
@types/csp-dev1.0.0 · 1×

For agents

$ claude mcp add chrome-extension-tools \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact