A modern template for creating Waze Map Editor (WME) userscripts using TypeScript, React, and Rollup.
- React + TypeScript support
- Rollup for efficient bundling
- WME SDK type definitions included
- Source maps support
- Automatic userscript header generation
- ESLint and Prettier configuration
- Node.js (v18 or higher recommended)
- npm or yarn
- Tampermonkey or similar userscript manager
- Create a new repository using this template
- Clone your repository:
git clone <your-repo-url> cd <your-repo-name>
- Install dependencies:
npm install
-
Edit
package.jsonto set your script details:{ "name": "your-script-name", "author": "your-name", "displayName": "Your Script Display Name", // optional "shortDisplayName": "Short Name", // optional "version": "1.0.0", "description": "Your script description" } -
Create your React components in the
srcdirectoryApp.tsxis your main component- Use the
asScriptTabHOC to create WME tabs - Import WME types from
wme-sdk-typings
-
Start the development server:
npm run dev
This will:
- Start Rollup in watch mode to compile your changes
- Start a local dev server at http://localhost:3000
-
Install the development version:
- Open http://localhost:3000/install-dev.user.js in your browser
- Tampermonkey will prompt you to install the development version
- The dev version will automatically load the latest changes from your local server
-
Important Development Setting:
Caution
In Tampermonkey settings, under "Externals" tab, set "Update Interval" to "Always"
- Write your script code starting with
src/App.tsx- Changes will be compiled automatically
- Refresh WME to see your changes
For production builds:
npm run buildFind the compiled scripts in dist/:
your-script-name.user.js- readable versionyour-script-name.min.user.js- minified version
The template includes TypeScript definitions for the WME SDK. More information here:
Waze Map Editor JavaScript SDK
├── src/
│ ├── index.tsx # Entry point
│ ├── App.tsx # Main component
├── rollup.config.ts # Rollup configuration
└── package.json # Project configuration
Run the build command to create production-ready scripts:
npm run buildThe compiled userscripts will be available in the dist directory.
This template is MIT licensed. See the LICENSE file for details.