This is a minimal Chrome extension built with TypeScript and Webpack. This version does not use React. Webpack is used for transpiling, bundling, and handling the asset folder.
- Listens for a click on the extension action button and sends a message to the content script.
- The content script monitors changes to the DOM and logs when a child node is added or removed.
- Typescript
- Types for Chrome Extension
- Webpack
- Node.js
- npm
-
Clone the repository:
git clone https://github.com/mburakeker/chrome-extension-typescript-webpack.git cd chrome-extension-typescript-webpack
-
Install dependencies:
npm install
To build the extension, run the following command:
npm run build
This will create a dist folder containing the bundled files.
- Open Chrome and go to
chrome://extensions/
. - Enable "Developer mode" by toggling the switch in the top right corner.
- Click on "Load unpacked" and select the
dist
folder.
public/manifest.json
: The manifest file that describes the extension.src/background.ts
: The background script that listens for the extension action button click.src/content.ts
: The content script that monitors DOM changes.src/types.ts
: TypeScript types and enums used in the project.webpack.config.cjs
: Webpack configuration file.tsconfig.json
: TypeScript configuration file.
Contributions are welcome! Please open an issue or submit a pull request.
This project is licensed under the MIT License.