A react boilerplate for building chrome extension.
Package | Version |
---|---|
Webpack | 5.x |
TypeScript | 4.x |
ESLint | 8.x |
PostCSS | 8.x |
Less | 4.x |
Node SASS | 8.x |
Stylelint | 14.x |
- Clone this repo.
- Run
npm install
. - Start by
npm start
. - Open chrome extensions chrome://extensions
- Click to load the extracted extension program and load the
dist
file in the project - Open a page that uses a micro-frontend, such as https://yx.jd.com/material/#/product, open the page developer tool to see the micro-app chrome plugin.
7.If you want to modify the code, new branch based on master
branch.
The plugin can be hot loaded and updated in real time during development
-
Open https://github.com/micro-zoe/micro-app-chrome-plugin/releases, click "Draft a new release" button.
-
Choose a tag or create a new tag. The versioning follows the Semantic Versioning 2.0.0 specification for semantic versioning.
-
Fill in the version number as the title. Include the update details in the description.
-
Upload the artifacts of the current version as attachments.
-
Publish release.
-
Modify the download link in README.md to an attachment link.
-
Open the relevant issue and create a branch in the "Development" sidebar. Please use only English for the branch name and avoid using Chinese.
-
Perform bug fixes on this branch.
-
When committing the code, include a comment in the commit message with the text "fixed #(issue number)" to reference the related issue.
-
This issue will be automatically closed.
-
Create a pull request with a title that includes "Fixed #(issue number)". This pull request will be automatically linked to the corresponding issue.
-
Wait for the reviewers to review the code. Once the code review is approved, the code will be automatically merged into the branch.
For WSL users, here's a trick you can develop in a linux sub system with hot reload, and preview in windows host system Chrome
application:
-
In WSL
npm start -- --distPath="/mnt/d/react-chrome-extension-boilerplate-dist"
-
In chrome: Load unpack extension from
D:/react-chrome-extension-boilerplate-dist