Develop Wikipedia userscripts quickly with Visual Studio Code
This project is quite basic and was made in a couple hours, however I've tested it and it should work, if not open an issue or pull request - they're appreciated!
Watch the video tutorial here
- Install the userscript here - note the "Develop" link that now appears next to your preferences link
- Make sure you have Visual Studio Code and NodeJS installed
- Open Visual Studio Code and under "Start" click "Clone Git Repository"
- In the prompt that shows, enter
https://github.com/wikimedia-gadgets/EasyWikiDev
- Select a new folder to develop your user script from. When asked if you would like to open the cloned repository, click "open".
- Click "Yes, I trust all the authors" to enable editing.
- On the left sidebar of Visual Studio Code, click "Run and Debug"
- In the run and debug pane, the play button next to "Start Server" to start the development server
- Click "Develop" to load your script. You should see the welcome message.
- Now, try editing
script.js
. As soon as you hit save, the page should reload and the latest version of the script will be loaded. - To release your script, simply copy the contents of
script.js
to your Wiki. You do not need to keep the demo code.
If you have any issues or errors, read them and try to fix them first, then ask for help or report a bug here.
This project only works on single page scripts and gadgets. It can't load more than one script locally yet - although I might add this functionality in the near future.