webpack-userscript icon indicating copy to clipboard operation
webpack-userscript copied to clipboard

Question: How to write userscript in TypeScript?

Open wilx opened this issue 2 years ago • 1 comments

Is it possible to write userscripts in TypeScript? Could you please provide an example project setup for this?

wilx avatar Apr 09 '23 09:04 wilx

Yes, it is.

Actually the TypeScript support is not directly provided by this plugin, but by webpack and ts-loader.

Here is a minimal example to build an userscript project written in TypeScript.

Run npm install and run npm run build to have a try. 😃

momocow avatar Apr 09 '23 15:04 momocow