Skip to content

Mpv script template with typescript building and bundling

License

Notifications You must be signed in to change notification settings

jonniek/mpv-typescript-template

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Typescript mpv script template

Template to write mpv scripts with typescript.

Setup

  1. Clone the repo into a directory with your new script name
  • git clone git@github.com:jonniek/mpv-typescript-template.git my-script
  • git clone https://github.com/jonniek/mpv-typescript-template.git my-script
  • Alternatively you can click "Use this template" button in Github
  1. Install dependencies npm install
  2. Build script file npm run build
  3. Add the output JS file to mpv as a script
  4. Observe hello world on mpv --idle

I was planning on making types for the mpv interface but that already existed in definitely typed. So creating this template if it helps someone get started since the TS config and bundling is kind of tricky.

I haven't tried this on anything non-trivial so there might be something missing, let me know if you bump into something.

If you want to distribute the built bundle in your repository, I would suggest setting up some git hooks to build and add the bundle into commits.

The bundle name is dir.js where dir is the name of your project directory. See rollup config to modify this.

About

Mpv script template with typescript building and bundling

Topics

Resources

License

Stars

Watchers

Forks