Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using ts-nameof with grunt #53

Open
mzohreh opened this issue May 20, 2019 · 2 comments
Open

Using ts-nameof with grunt #53

mzohreh opened this issue May 20, 2019 · 2 comments
Labels

Comments

@mzohreh
Copy link

mzohreh commented May 20, 2019

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

@dsherret
Copy link
Owner

dsherret commented May 20, 2019

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...

  1. Follow these instructions: https://github.com/dsherret/ts-nameof/blob/master/packages/ts-nameof/setup/tsc.md -- Except for the last step about compiling.
  2. Specify ttypescript as 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.

@mzohreh
Copy link
Author

mzohreh commented May 20, 2019

Thanks you @dsherret. I will try and let you know

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants