create-typescript-extension v1.0.0-alpha.2
Typescript Chrome Extension Starter
š Overview
A robust, modern starter template for building Chrome extensions using TypeScript, Webpack, and best practices for browser extension development.
š Installation
To create a new project, run the following command:
npx create-typescript-extension <project-name>
or to create a project in the current directory, run the following command:
npx create-typescript-extension .
š Installation to the system
To install the CLI to the system, run the following command:
npm install -g create-typescript-extension
and then you can use the CLI to create a new project by running the following command:
create-typescript-extension <project-name>
⨠Features
- š§ TypeScript support
- š¦ Webpack bundling
- š Content script and service worker integration
- š Secure content security policy
- š Manifest v3
- š„ Hot reloading in development mode
š Prerequisites
- Node.js (v18+ recommended)
- npm or yarn
- Chrome Browser (or any other Chromium based browser)
š„ Development
Running in Development Mode
yarn dev
Building for Production
yarn build
Loading in Chrome
- Open Chrome and navigate to
chrome://extensions/
- Enable "Developer mode"
- Click "Load unpacked" and select the project directory
- You don't need to select the
dist
directory, it's already set in the manifest.json
š Project Structure
āāā src/
ā āāā content/
ā ā āāā index.ts # Content script entry point
ā āāā worker/
ā āāā index.ts # Service worker entry point
āāā dist/ # Compiled extension files
āāā webpack.config.js # Webpack configuration
āāā tsconfig.json # TypeScript configuration
āāā manifest.json # Chrome extension manifest
š Permissions
The extension requests the following Chrome permissions by default. You can modify the permissions in the manifest.json file.
scripting
activeTab
storage
declarativeNetRequest
tabs
š¤ Contributing
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature
) - Commit your changes (
git commit -m 'Add some AmazingFeature'
) - Push to the branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
š License
Distributed under the MIT License. See LICENSE
for more information.
š Contact
Harshit Budhraja - @harshitbudhraja on X (previously, Twitter)
Note: This is a starter template. Remember to customize it to fit your specific extension's needs!
7 months ago
7 months ago