react-chrome-extension-cli v0.2.2
React Chrome Extension CLI
The CLI next Chrome Extension. ๐
Quick Overview
npm install -g react-chrome-extension-cli
react-chrome-extension-cli my-extension
cd my-extension
npm run watchThen follow these instructions to see your extension: 1. Open chrome://extensions 2. Check the Developer mode checkbox 3. Click on the Load unpacked extension button 4. Select the folder my-extension/build
When you're ready to publish to Chrome Web Store, create a minified bundle with npm run build and then zip the build folder.
Get Started Immediately
You donโt need to install or configure Webpack. Webpack comes in preconfigured, so that you can focus on the code.
Just create a project, and youโre good to go.
Creating an Extension
Installation
npm install -g react-chrome-extension-cliUsage
react-chrome-extension-cli <project-name>Example:
react- chrome-extension-cli my-react-extensionIt will create a directory called my-extension inside the current folder.
my-extension
โโโ README.md
โโโ node_modules
โโโ package.json
โโโ .gitignore
โโโ config // Webpack with minimal configurations
โ โโโ paths.js
โ โโโ webpack.common.js
โ โโโ webpack.config.js
โโโ public
โ โโโ icons
โ โ โโโ logo.png
โ โโโ *.html // HTML files will vary depending on extension type
โ โโโ manifest.json
โโโ src
โโโ *.css // CSS files will vary depending on extension type
โโโ *.js // JS files will vary depending on extension typeOnce the installation is done, you can open your project folder:
cd my-extensionInside the newly created project, you can run some built-in commands:
npm run watch
ไธๅฎ่ฆ่ฐๆดไธบๅผๅ่
ๆจกๅผ
ๅฝไฝฟ็จ npm run build ๆๅ
ๅฎๆฏ๏ผๅฏไปฅๅ ่ฝฝๅฐ chrome ๆต่งๅจไธญ
- ๆๅผ chrome://extensions
- ็กฎไฟๆๅผไบๅผๅ่ ๆจกๅผ
- ็นๅป Load unpacked extension ๆ้ฎ
- ้ไธญ my-extension/build ็ฎๅฝ
npm run build
Builds the app for production to the build folder. Zip the build folder and your app is ready to be published on Chrome Web Store.