Closed jmacura closed 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
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...
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:
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.
thanks for this!
I am glad I could help.
These two commits mitigate the behaviour of setupTypeScript.js script in the sveltejs/template repository for use with webpack.