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

build in 'prepare' script #14

Closed
adrian-delgado opened this issue Jul 16, 2019 · 2 comments
Closed

build in 'prepare' script #14

adrian-delgado opened this issue Jul 16, 2019 · 2 comments

Comments

@adrian-delgado
Copy link

Is your feature request related to a problem? Please describe.
It would be nice to not require typescript installed globally when yarn add/npm installing this package.

Describe the solution you'd like
running tsc -p tsconfig.json in the prepare script instead of the postinstall should have access to the node_modules folder. Also including typescript (or tsc) as a dev dependency will be required. This way the tsc command will reference typescript from the node_modules folder.

Describe alternatives you've considered
none

Additional context
sorry if this has been tried before, but I suppose there has to be a way to not require the consuming project to have global node modules installed.

@djorg83
Copy link

djorg83 commented Aug 18, 2019

I agree with the above ^ request. You should generally avoid publishing files that need to be compiled/transpiled in order for the package to be used. Please consider compiling your typescript into a /dist folder, then only publish the contents of the /dist folder to npm. This can be accomplished via .npmignore and/or the package.json "files" attribute.

Edit:
I came here because this broke my build pipeline, because this particular project Im working on is not using typescript, which is why tsc wasn't installed on the build server.

@rolandpeelen
Copy link

I agree to both these, my build pipeline breaks too. Here is a PR to the proposed solution: #19

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

No branches or pull requests

4 participants