-
Notifications
You must be signed in to change notification settings - Fork 200
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
Bundler causes rejoining of original streams instead of modified ones #1335
Comments
fyi, the |
Just setting up a new project and ran into the exact same issue. Does anyone how to fix the bundler? |
This was brought up in https://github.com/Polymer/polymer-build/issues/93 We are waiting on #108 to fix this since it moves us to the new bundler. Once that's in place, we can make sure it's getting the right files. @tony19 link to the issue with the bugs that you're seeing? |
@FredKSchott thanks for the explanation. Have u got a rough idea when #108 is going to land? |
Both @usergenic and I are working on it all this week. If anyone would like to contribute a code review as well, feel free! |
Is there any workaround until the new bundler lands? I tried crisper w/ vulcanize but that didn't workout too well, I guess b/c of the PRPL structure of the app. |
Running optimizers after the bundler is the current work around. |
I'm also having problems with this. Something new? |
Friendly ping. :) |
@usergenic has this on his radar but is juggling some other things as well. If anyone wants to take over and create a PR in the mean time I would be happy to help advise |
Seems like |
@stramel no fix for this has been released yet / in v0.8.1. Again, until this is fixed the current work-around is to run optimizers after the bundler instead of before. |
BTW, what is the benefit of running optimizers before bundling? I mean, splitting and rejoining lot of files (e. g. 300+ elements) is slower than post-processing of few bundles, isn't it? |
Optimizing before bundle lets you process your source files and dependencies separately. So if you wanted to use something like babel to compile your sources only, you can. If you aren't handling your sources and dependencies separately, optimizing after bundling will probably give you a performance boost. |
@FredKSchott Oops! You're correct, I think I got a bit over excited about the new release. Can't wait until this is fixed! |
@FredKSchott that is exactly my workflow: babel + bundle. The current state of things makes it impossible—since I can't not babel, my only workaround is to not bundle 😢 ; In browsing through the source code, I think the issue is that Whatever processing happens on the streams after The old way of doing it had the analyzer as its own processor; the streams were piped through it after custom processing and after stream merge, immediately before bundling. It was a little slower, because you always had to analyze and then merge after all the post-processing was done: you couldn't do it asynchronously, like it currently works. Unless you can somehow "plug" into a stream later, I don't see a great way around this—the least wrong thing I can come up with is a breaking change that returns to the "old way" of explicitly calling the analyzer after merging the streams back together. |
@web-padawan yes, that was the old workflow, even with |
@myw would it be possible to use two streams then? like the analyzer being used to analyze the original stream and then bundle the modified stream (like after babel). I would like to know where in the files where this works so I can look at it as well... |
@tjmonsi the problem is you can't get the stream without calling the analyzer |
Is there going to be a tag soon for @usergenic's awesome fix? |
Description
When the build stream is passed through the bundler, the result contains the original split streams instead of the modified ones (e.g., processed by
uglify
or other minifiers).Versions & Environment
Steps to Reproduce
Generate project from
generator-polymer-init-custom-build
2.0.0.Install
gulp-uglify
:Edit the project's
gulpfile.js
to usegulp-uglify
, and uncommentgulpfile.js:46
, which runsuglify
:Run
gulp build
.Observe the output of
build/src/my-view1.html
does not contain minified JS.Comment out
gulpfile.js:69
, which pipes the build through the bundler:Run
gulp build
.Observe the output of
build/src/my-view1.html
contains minified JS.Expected Results
Output files contain modified streams.
For example, minified JS like this:
Actual Results
Output files contain original/unmodified streams from
HTMLSplitter
.For example:
The text was updated successfully, but these errors were encountered: