A template for Gleam browser extensions.
This project uses Lustre and Lustre Ui for simplicity.
Webpack is also used here, and WebpackObfuscator is added as an example.
You donβt need to configure Webpack.
Webpack comes in preconfigured, so that you can focus on the code.
Just clone this repo, run npm i
and youβre good to go.
Current project structure:
gleam-browser-extension
βββ README.md
βββ build
βββ release
βββ node_modules
βββ index.html
βββ gleam.toml
βββ manifest.toml
βββ manifest.json
βββ package.json
βββ pack.mjs
βββ pack.toml
βββ .gitignore
βββ config // Webpack with minimal configurations.
β βββ paths.mjs
β βββ webpack.common.mjs
β βββ webpack.config.mjs
βββ priv/static
β βββ icons
β β βββ icon_16.png
β β βββ icon_32.png
β β βββ icon_48.png
β β βββ icon_128.png
β βββ app.mjs // Compiled app.
βββ test
β βββ *.gleam // Gleam test files.
βββ src
βββ *.gleam // Gleam source files.
You can run some built-in commands:
Runs the app in development mode.
Then follow these instructions to see your app:
- Open chrome://extensions
- Check the Developer mode checkbox
- Click on the Load unpacked extension button
- Select the project folder
Or just open localhost:1234.
Builds the app for production.
Run npm run pack
to
copy just the extension files into the release
folder.
Packs extension files into the release
folder.
Rebuilds and packs the app.
It is a shorthand for npm run build && npm run pack
.
Suggestions and pull requests are welcomed!
Many thanks to Chrome Extension CLI for the inspiration with this readme file.