sparse-intern-71089
01/08/2020, 4:04 PMbroad-helmet-79436
01/08/2020, 4:09 PMbroad-helmet-79436
01/08/2020, 4:09 PMimport
isn’t valid in node unless the file is an .mjs
file and you’re in node 13 or newerbroad-helmet-79436
01/08/2020, 4:09 PMbroad-helmet-79436
01/08/2020, 4:09 PMstocky-island-3676
01/08/2020, 4:12 PM.gitignore
d, i.e. not in the Github repo. That could explain why it works locally.
You know what the best-practice is?broad-helmet-79436
01/08/2020, 4:15 PMbroad-helmet-79436
01/08/2020, 4:17 PMbroad-helmet-79436
01/08/2020, 4:18 PM"main"
field to point to the transpiled codebroad-helmet-79436
01/08/2020, 4:18 PMbuild/index.js
or somethingstocky-island-3676
01/08/2020, 4:23 PMpackage.json
, or?
"scripts": {
"build": "tsc"
},
(taken from https://github.com/pulumi/pulumi-gcp/blob/master/sdk/nodejs/package.json#L12-L14)
The other way would be to push also the transpiled JS file to the Github repo.stocky-island-3676
01/08/2020, 4:52 PM"scripts": {
"build": "tsc",
"prepare": "npm run build"
},
doesn’t work, either.
(The prepare
part is from https://www.reddit.com/r/typescript/comments/9ctsbd/how_do_i_publish_a_typescript_library_to_a/e5db0e4/)broad-helmet-79436
01/08/2020, 6:38 PMbroad-helmet-79436
01/08/2020, 6:38 PMstocky-island-3676
01/09/2020, 12:49 PMgit+https://
.
Seems like pushing the transpiled JavaScript code is the way to go, as you mentioned. Others take the same approach:
https://stackoverflow.com/questions/55002806/how-to-publish-a-private-typescript-npm-package-in-git/55004794#55004794