ts-nameof
ts-nameof copied to clipboard
Using ts-nameof with grunt
Hi,
I am trying to set this library up with grunt, but there doesn't seem to be an easy way to do this. I cant use TSC way either as it is relying on another dependency:
https://github.com/dsherret/ts-nameof/blob/master/packages/ts-nameof/setup/tsc.md
Custom set up requires me to write my own transformer, which is not the direction i want to go. So is it possible to use this package with grunt without an overly complicated set up?
https://github.com/dsherret/ts-nameof/blob/master/packages/ts-nameof/setup/custom.md
Thanks Juju
Hi @mzohreh, are you using grunt-ts? It doesn't seem to support custom transforms (but does seem to have its own transforms feature).
What you could do is use the custom compiler option though. So...
- Follow these instructions: https://github.com/dsherret/ts-nameof/blob/master/packages/ts-nameof/setup/tsc.md -- Except for the last step about compiling.
- Specify
ttypescriptas a custom compiler (read more here: https://www.npmjs.com/package/grunt-ts#compiler). I think the following would work:grunt.initConfig({ ts: { options: { // or try just 'ttypescript' or './node_modules/ttypescript' // I haven't tested what works... compiler: './node_modules/ttypescript/bin/tsc' } } });
Hopefully that will work.
Thanks you @dsherret. I will try and let you know