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

Consider including browser flag in package.json #1102

Closed
kpdecker opened this issue Sep 25, 2015 · 3 comments
Closed

Consider including browser flag in package.json #1102

kpdecker opened this issue Sep 25, 2015 · 3 comments
Labels
Milestone

Comments

@kpdecker
Copy link
Collaborator

Want to set the browser field to either the dist/handlebars file or lib/handlebars to avoid issues with require.extension code being included on the client.

Should look at using browser as an object rather than a string:
https://github.com/defunctzombie/node-uuid/blob/master/package.json#L30

This might let us handle the runtime and the full library.

@ouijan
Copy link
Contributor

ouijan commented Aug 21, 2019

This would be incredibly useful for circumstances where we don't have access to a webpack.config.

For example, import * as Handlebars from 'handlebars'; within an angular project causes the fs not found issue because it is importing the wrong build. It should be pointing to dist/handlebars.min.js.

Using import * as Handlebars from 'handlebars/dist/handlebars'; causes typedef errors.

@nknapp
Copy link
Collaborator

nknapp commented Aug 21, 2019

I'm open for trying this. Could you open a PR to the 4.x branch?

The difficult part is determining whether this has any breaking side-effects for other users. Any ideas?

@ouijan
Copy link
Contributor

ouijan commented Aug 22, 2019

I've opened a PR to add browser to the package.json #1540. It's hard to write a test for this kind of change I know it resolves issues in my use case but welcome ideas on how to more reliably test it.

nknapp added a commit that referenced this issue Aug 25, 2019
added browser to package.json, resolves #1102
@nknapp nknapp closed this as completed in 5eb59a5 Sep 3, 2019
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