Skip to content

[Service Bus] Add package.json to package (fixes #2857)#2892

Merged
ramya-rao-a merged 2 commits into
masterfrom
add-pkgjson
May 15, 2019
Merged

[Service Bus] Add package.json to package (fixes #2857)#2892
ramya-rao-a merged 2 commits into
masterfrom
add-pkgjson

Conversation

@bterlson
Copy link
Copy Markdown
Member

@bterlson bterlson commented May 14, 2019

package.json is copied into the dist-esm folder but needs to be published as part of the package as well.

@bterlson bterlson requested a review from ramya-rao-a May 14, 2019 19:26
@ramya-rao-a
Copy link
Copy Markdown
Contributor

But why....

@bterlson
Copy link
Copy Markdown
Member Author

When you compile a project that import's a JSON file, TypeScript will copy the json file into the output along with the other build artefacts. Otherwise relative imports are broken - note how src/index.ts gets built into dist/src/index.ts, so the path "../package.json" relative to index.ts would be broken unless TS copied it over for you.

Basically, if you import a json file, TS treats it as a source file including emitting it into outDir.

@ramya-rao-a ramya-rao-a merged commit 591c17a into master May 15, 2019
@KarishmaGhiya KarishmaGhiya deleted the add-pkgjson branch September 23, 2019 18:18
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

Successfully merging this pull request may close these issues.

2 participants