sveltejs / template-webpack

Template for building basic Svelte applications with webpack
300 stars 118 forks source link

Add setupTypeScript.js #35

Closed jmacura closed 3 years ago

jmacura commented 3 years ago

These two commits mitigate the behaviour of setupTypeScript.js script in the sveltejs/template repository for use with webpack.

benmccann commented 3 years ago

This PR would need to be rebased

It would be nice to structure this with methods similar to the version in sapper-template: https://github.com/sveltejs/sapper-template/blob/master/scripts/setupTypeScript.js

jmacura commented 3 years ago

Rebased.

I intended to keep the code as much consistent with https://github.com/sveltejs/template/blob/master/scripts/setupTypeScript.js as possible. So it is easier to debug once and fix twice. But if you prefer the sapper-style version, @benmccann , I can do that change...

benmccann commented 3 years ago

The Sapper one is newer. Ideally we would have went back and cleaned up https://github.com/sveltejs/template/blob/master/scripts/setupTypeScript.js to keep them all in sync in the new style, but no better time to start :smile:

jmacura commented 3 years ago

I have aligned the code with https://github.com/sveltejs/sapper-template/blob/master/scripts/setupTypeScript.js as proposed. The only part which didn't work for me, was deleting the script itself, so I have added an additional try/catch block there. I am using Node v14.14 @ Windows 10.

benmccann commented 3 years ago

thanks for this!

jmacura commented 3 years ago

I am glad I could help.