additionalExtensions should be ['ts', 'tsx']
additionalExtensions is []
@b-m-f You need to do await nuxt.ready() AFAIK so it properly setup the module (it will call the module container that is responsible to register modules).
Without doing it it will trigger the build without having called @nuxt/typescript-build so you won't have additionalExtensions properly set.
Alternatively, you can also register the TS @nuxt/typescript-build module this way : https://github.com/nuxt/typescript/blob/master/packages/typescript-build/test/module.test.ts#L36
Thanks. Will try it out on wednesday when I am back on the codebase. Seems like this will likely be the culprit! It did smell like an Synchronization problem :)
@kevinmarrec This was indeed the problem. Is there a place I could add some documentation for this?
@b-m-f I think it's related to https://github.com/nuxt/typescript/issues/139 request, i'd say new Guide section about Programmatic usage
Ok, so took me like an hour to figure out why middleware wasn't picking up .ts files until I stumbled upon this issue.
Current solution for me is to add additionalExtensions: ['ts'] in the nuxt.config.js build object.
I think the default option should include .ts files.
BTW: I'm using Nuxt programmatically.
Closed by #233
Most helpful comment
@b-m-f I think it's related to https://github.com/nuxt/typescript/issues/139 request, i'd say new Guide section about Programmatic usage