Simple Chrome extension template to use react, tailwindcss, and daisyui
npm update
to install updated dependanciesnpm start
to start running the fast development mode Webpack build process that bundle files into the dist
foldernpm i --save-dev <package_name>
to install new packageschrome://extensions/
Developer mode
in the top right cornerLoad unpacked
dist
folderChrome extension template code is inside of the src
folder. It contains the following folders:
background
: Contains the background.ts
file contentScript
: Contains contentScript.ts
or the Content Script fileoptions
: Contains options.tsx
and index.tsx
. options.html
is generated from those 2 files when building the chrome extensionpopup
: Contains popup.tsx
, popup.css
, as well as a few starter react components that are Button.tsx
and MainPage.tsx
. popup.html
is generated from those 2 files when building the chrome extensionstatic
: Folder that contains assets like icon.png
and the manifest.json
file need to build the chrome extensionassets
: Folder that contains the tailwind.css
file that imports tailwindcss.
├── LICENSE
├── package.json
├── package-lock.json
├── postcss.config.js
├── README.md
├── src
│ ├── assets
│ │ └── tailwind.css
│ ├── background
│ │ └── background.ts
│ ├── contentScript
│ │ └── contentScript.ts
│ ├── options
│ │ ├── index.tsx
│ │ └── options.tsx
│ ├── popup
│ │ ├── Button.tsx
│ │ ├── index.tsx
│ │ ├── MainPage.tsx
│ │ ├── popup.css
│ │ └── popup.tsx
│ └── static
│ ├── icon.png
│ └── manifest.json
├── tailwind.config.js
├── tsconfig.json
├── webpack.common.js
├── webpack.dev.js
└── webpack.prod.js
7 directories, 22 files
git init
to start a new git repo for tracking your changes, do an initial base commit with all the default filespackage.json
, important fields include author
, version
, name
and description
manifest.json
, important fields include version
, name
and description
webpack.commmon.js
, the title in the getHtmlPlugins
function should be your extension namenpm run build
to generate a minimized production build in the dist
folderdist
folder (e.g. dist.zip
) via the command zip -r dist.zip dist/
icon.png
instead of ../static/icon.png
)tailwind.config.js
file MUST include the snippet require("daisyui")
inside of the plugins array:module.exports = {
content: [
"./src/**/*.{js,jsx,ts,tsx}",
],
theme: {
extend: {},
},
plugins: [require("daisyui")],
}