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

bower.json missing "main" and "moduleType" #525

Closed
unscriptable opened this issue Jun 6, 2014 · 3 comments
Closed

bower.json missing "main" and "moduleType" #525

unscriptable opened this issue Jun 6, 2014 · 3 comments

Comments

@unscriptable
Copy link

Any automated tools and/or build tools can't consume polymer without additional configuration work since polymer's bower.json is missing a "main" property. It is also missing a "moduleType" property, but that is arguably less important (but why not add it?).

I know there is a bit of contention about what "main" should point to, but most JavaScript packages that export a global script point it to a single un-minified file.

Since there is no un-minified file in this repo, the "main" property would point to the minified polymer.js, I guess? Unfortunately, this is nearly useless to us since folks would have to add additional manual configuration in order to bypass polymer when performing minification.

Is there any chance we could have the un-minified polymer.js included in this repo and point the "main" property at it?

Thanks guys!

@robdodson
Copy link
Contributor

@azakus ?

@robdodson
Copy link
Contributor

Sorry for the delay on this. It turns out there's more to it than just simple concat/minification.

Many/most components rely on an HTML Import of polymer.html which pulls in its own, minified copy of polymer.js. You wouldn't want to bundle an unminified copy of polymer.js into your own source because then you would load polymer twice (when your own js loads, and when the first element requests polymer.html).

You can vulcanize everything with csp and inline flags set to true, that will pull polymer.js, and the js from all of your other elements into one file. Then you can use uglify to tack on your application JS. I threw together an app to try to figure out what's the smallest distribution I can get. I wasn't able to minify platform.js with everything else, so for now it's still a separate script that gets loaded before everyone.

@unscriptable
Copy link
Author

Thanks for the response, @robdodson. It's not clear to me how ES6 Loaders and HTML imports can work together. Somebody will figure it out, eventually. :)

Still, it's now clear that a minified polymer.js would violate the bower spec. They recently updated it: https://github.com/bower/bower.json-spec#main (see second bullet, "Do not include minified files.").

Feel free to close this issue if you want to defer resolution of this problem until there's a better understanding about how to consume polymer via bower. Thanks for your help!

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

No branches or pull requests

2 participants