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

fix build #249

Closed
moltar opened this issue Mar 5, 2020 · 3 comments
Closed

fix build #249

moltar opened this issue Mar 5, 2020 · 3 comments
Assignees
Labels

Comments

@moltar
Copy link
Contributor

moltar commented Mar 5, 2020

There is a super weird issue that I have been banging my head against the wall on this one.

When you run:

npm run build

It creates the following structure:

lib
├── package.json
└── src
    ├── index.d.ts
    ├── index.js

...

But what we want is:

lib
├── index.d.ts
├── index.js
├── index.js.map

Basically, the package.json does not need to be there, and then the src will flattened into the lib.

I just don't understand why the package.json is copied over.

The strange thing, that this project is configured almost identical to https://github.com/ScaleLeap/amazon-marketplaces yet amazon-marketplaces does not copy package.json over.

Please continue in PR #248 which I already started.

@nguyentoanit
Copy link
Contributor

@moltar:
I found cause of this issue. Because we get name and version from package.json file. So typescript compiler copied it.

What is the purpose of USER_AGENT in src\constants.ts file?
``export const USER_AGENT = `${name}/${version}```

I'm not sure about the meaning thus i didn't resolve them.

@moltar
Copy link
Contributor Author

moltar commented Mar 6, 2020

Ohh great find! Thanks!

moltar added a commit that referenced this issue Mar 6, 2020
importing package.json directly from the require / import system causes
it to be bundled with the transpiled code in ./lib which then causes
problems with release.

Closes #249
@moltar moltar closed this as completed in f8b30e8 Mar 6, 2020
github-actions bot pushed a commit that referenced this issue Mar 6, 2020
## [1.1.3](v1.1.2...v1.1.3) (2020-03-06)

### Bug Fixes

* ESLint config issue ([c9d3cfd](c9d3cfd))
* references to package.json ([f8b30e8](f8b30e8)), closes [#249](#249)
@github-actions
Copy link

github-actions bot commented Mar 6, 2020

🎉 This issue has been resolved in version 1.1.3 🎉

The release is available on:

Your semantic-release bot 📦🚀

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