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

Please support angular cli or publish a browser packed package #208

Closed
kbirger opened this issue Jul 2, 2018 · 11 comments
Closed

Please support angular cli or publish a browser packed package #208

kbirger opened this issue Jul 2, 2018 · 11 comments

Comments

@kbirger
Copy link

kbirger commented Jul 2, 2018

Currently, Angular CLI doesn't let you customize the webpack config that it generates, making it effectively impossible (to my knowledge) to use it in a project which uses Angular CLI.

Please add support for this in whichever way you think would be best. It is possible that the simplest solution would be to publish a separate package with the wzrd.in version.


[2019-01-01] A note from broofa (the project maintainer)

This is an issue with Angular, not with this project. I'm only leaving this comment open to make it more visible for people struggling with the same issue.

Want to help? Go read angular/angular-cli#5043 (comment) , and then add your thoughts there. Unless/until someone from the Angular projects makes a compelling argument for why this isn't actually their issue, I won't be acting on this.

Until then, consider using https://github.com/marlon360/mime-wrapper to workaround this issue.

@broofa
Copy link
Owner

broofa commented Jul 2, 2018

While I'm tempted to fix this just to silence the recurring complaints I get about this, I don't believe this is a mime-specific issue. It's an Angular problem (see above reference). Feel free to chime in on that issue. In the mean time, use the mime-wrapper module?

@kbirger
Copy link
Author

kbirger commented Jul 2, 2018

It seems like I misunderstood the problem when opening the issue. From looking at the mime-wrapper code, it seems that the whole issue is solved by adding '.json' to the require calls?

While I recognize that this is a fault in the angular tooling, would it not be simpler, and still standards-compliant to simply call require with the appropriate extension? The format of those required files will not change without a new version of your package, so what's the harm in explicitly requiring json?

I will, in the meantime, do as you suggest and use the wrapper.

@marlon360
Copy link
Contributor

Here is a wrapper ready for Angular CLI: https://github.com/marlon360/mime-wrapper

@omarsourour
Copy link

It really can be solved simply by adding the .json extension. I am currently having to use the mime-wrapper library, but that just means I am hoping you don't change any of your innards file organization.

@broofa
Copy link
Owner

broofa commented Feb 1, 2019

@omarsourour See note I just added to description.

@broofa
Copy link
Owner

broofa commented May 14, 2019

If someone wants to fixup src/build.js per this comment, I'd take a PR.

@marlon360
Copy link
Contributor

I made a PR #226 with the necessary changes according to this comment.

@broofa broofa closed this as completed in f348aba May 15, 2019
@broofa
Copy link
Owner

broofa commented May 15, 2019

Thanks for jumping on this, @marlon360. Fix is up on npm as v2.4.3. Let me know if you see any problems.

@viceice
Copy link

viceice commented May 16, 2019

This is actually a breaking change, because you changed the package layout.

If I update to the new bugfix release it would break my build, because of the changed file extension.

@broofa
Copy link
Owner

broofa commented May 16, 2019

@viceice While I sympathize, since this is not a change to the public API it does not constitute a breaking change. From https://semver.org/ (emphasis mine):

Once you identify your public API, you communicate changes to it with specific increments to your version number

@viceice
Copy link

viceice commented May 16, 2019

Ok, i thought, the types json files were actually public api.

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

No branches or pull requests

5 participants