-
Notifications
You must be signed in to change notification settings - Fork 44
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
How to get a build version of polymer components ? #147
Comments
Keep in mind that when a browser (including mobile) is served the app, the entire bower_components folder is not served, only the individual imported files. So your actual app size in terms of data use may be lower than you realize. At the moment though, I'm not aware of any tooling or task that's been created to build/concat/minify Polymer html imports within Angular. That's on everyone's mind, but I think it's lower priority compared to getting Polymer itself working fully. |
@hotforfeature Correct, the actual app loaded in the browser will be what it is required. But the issue is, polymer components using server space and in mobile building, the app size actually matters. |
@sarathsaleem try If not enough, using polymer-bundler directly with |
@hotforfeature But one problem would still be that the web app would do individual reqeusts for every import right? So quite a lot if we are using http1 |
That's right, though there's quite a lot of HTTP2 support. Only IE11 on Windows 8/lower and Safari on OS X lower than 10.11 do not support it: http://caniuse.com/#feat=http2 The Polymer CLI can generate |
@hotforfeature that is true. But we have an iOS app that access the app over |
@BorntraegerMarc not sure what is the problem with individual imports. |
Sorry, wasn't clear enough @platosha. I meant individual http requests. But I think it would solve it. I'll try and get back at you |
Hmm, @platosha I'm getting an error. This is how I do the build:
this is the error I get: I mean call me crazy but I still see after the build that the app does like 140 requests... Any ideas? |
Ah, OK I think I fixed the error. But the app still does 140 requests. But I'll open a issue over at the polymer build project |
Ah, no I just copied over the wrong JS file. Sorry, the error still persists... |
yeah @platosha after running |
@BorntraegerMarc could you try:
Hope that isolates side-effects of |
@platosha That did the trick for the 140 requests. Now I only see 9 requests left. But I still see the same error. |
and also interesting: Then it works! I guess the problem is with |
@platosha and one additional error came up when using the I never saw something like this also googling did not really bring me any further... UPDATE: The error was caused by something else |
To clarify: bundled version is not working but unbundled version is working fine. Working on something now to solve https://github.com/Polymer/polymer-cli/issues/283 |
Another update: If you configure your own |
In order to work with angular-cli , there is a suggestion to change the bower path to assets/bower_components. So this will work and all the bower components will be part of the build.
.bowerrc
But ng build just copies the whole assets folder and all the files, bower_components folder itself is copied as it is. This will create a large size for the application. For a mobile hybrid application, this will lead to packaging issues.
For just include a polymer calendar component the app size increased up to 30 MB.
So how to get the files only required for the application, (eliminate demo, test etc from bower_components) along with angular-cli ng build ?
Or is there any separate gulp task to do this polymer component building ? It can be integrated to ng build ?
The text was updated successfully, but these errors were encountered: