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

Remove browser field from package.json #260

Closed
ravikiran438 opened this issue Jul 26, 2018 · 4 comments
Closed

Remove browser field from package.json #260

ravikiran438 opened this issue Jul 26, 2018 · 4 comments
Labels

Comments

@ravikiran438
Copy link
Contributor

The use of the browser field in package.json is superfluous as it just points to a bundled file of all the modules and results in the inclusion of contentful.browser.js in the final webpack bundle thereby defeating the purpose of using es6 modules for tree shaking. The purpose of the browser field is to provide code that is specific to a browser (for example it uses polyfills or shims), but that is not relevant for this lib at present. For spec of browser field see: https://github.com/defunctzombie/package-browser-field-spec

Steps to Reproduce

  1. Launch bundle analyzer with release tag 6.1.0 and then verify with tag 6.1.1

Here is the relevant PR #247
Also same with contentful-management
contentful/contentful-management.js#171

@axe312ger
Copy link
Collaborator

Which might break Angular 6 again :/

We need to think this through first and then come up with a solution asap. Thanks for the report @ravikiran438

@axe312ger axe312ger added the bug label Jul 27, 2018
@ravikiran438
Copy link
Contributor Author

ravikiran438 commented Jul 31, 2018

@axe312ger ,

As mentioned in angular/angular-cli#10681 (comment)

adding

  "browser": {
    "os": false
  },

to package.json in contentful-sdk-core or using

https://github.com/CoderPuppy/os-browserify

both seem to work fine with angular 6 builds

I can send out a PR if you would like to add any of those workarounds.

Thanks!

@Khaledgarbaya
Copy link
Contributor

Hey @ravikiran438,
Please feel free to send a PR
Best,
Khaled

@ravikiran438
Copy link
Contributor Author

@Khaledgarbaya Please check the following PR contentful/contentful-sdk-core#62

axe312ger pushed a commit to contentful/contentful-management.js that referenced this issue Aug 7, 2018
…aking

Starting Angular CLI 6.x, no empty modules are supplied for node globals, see:
angular/angular-cli#9827
contentful/contentful.js#260
axe312ger pushed a commit that referenced this issue Aug 7, 2018
…aking

Starting Angular CLI 6.x, no empty modules are supplied for node globals, see:
angular/angular-cli#9827
#260
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

3 participants