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

Result contains list of unbundled files as well/ #90

Closed
TheWix opened this issue Jun 1, 2016 · 17 comments
Closed

Result contains list of unbundled files as well/ #90

TheWix opened this issue Jun 1, 2016 · 17 comments

Comments

@TheWix
Copy link

TheWix commented Jun 1, 2016

Hey there, it would be be cool to be able to get a list of files that went into the bundle in the result file. in Dev we like to have the individual files rather than trying to debug a big bundle, and I could use the result file to print the individual scripts.

@chmontgomery
Copy link
Contributor

Are you able to debug using sourcemaps? In the past that has been enough for me, at least in Chrome dev tools, because you can put break points in the original file.

That said, this enhancement wouldn't be difficult to accomplish considering we're already printing each file during ingestion. I don't have time right now but I accept PRs.

@TheWix
Copy link
Author

TheWix commented Jun 2, 2016

Normally yes, we find however, that debugging with typescript and sourcemaps to be buggy at times so we end up debugging the raw JS. Cool, I will look at coming up with a PR. Thanks, bud.

@chmontgomery
Copy link
Contributor

@TheWix makes sense. I've also had problems in the past debugging transpiled code (babel, etc).

For the result file, I'm thinking it would make sense to not have the original files by default. You could enable this functionality by adding a new bundle option. The actual code change could look similar to this recent PR. Basically you would end up passing down the entire src file list as a property on the streaming files. The biggest thing is that this could slow down the gulp processing if the list is huge, so again keep it as an option that is off by default (and doesn't pass the src files down).

@AndrewCraswell
Copy link

+1, my team has been needing this enhancement as well. In addition, we've found that our codebase is so large that doing the bundle takes 8-10 seconds. This is agonizing when you're waiting for a watch task do a rebuild.

@AndrewCraswell
Copy link

@PlasmaPower
Copy link
Contributor

PlasmaPower commented Sep 27, 2016

I've begun work on this issue. I expect to finish tomorrow, but things may come up.

@PlasmaPower
Copy link
Contributor

PlasmaPower commented Sep 27, 2016

I think I have a good idea of how to do this, but where should I add this into the results JSON? Every key seems to be user generated. It looks like hard coding a key to serve this purpose might be our only option. We could also change the format of the file when the option is enabled, but I wouldn't recommend that as it'd cause more issues than a hard coded key.

@gentoo90
Copy link

Hey guys, any news on this?

@nathanwoulfe
Copy link

@PlasmaPower - is this any chance of happening? If the generated JSON file kept its existing structure but added a scriptsRaw and stylesRaw property which stored a string representing the included files, that would be amazing...

myBundle: {
    stylesRaw: "<link href='style1.css' media='all' rel='stylesheet' type='text/css'/><link href='style2.css' ... />"
},

I'm in the same boat as other commenters, where the bundling process takes 15+ seconds, so would prefer to be able to render the source files in dev, but the bundles in prod.

@PlasmaPower
Copy link
Contributor

I'm coming back to this issue after a while, so I might be missing something, but I think at that time I was thinking that a user might name a bundle part scriptsRaw, conflicting with this.

@PlasmaPower
Copy link
Contributor

PlasmaPower commented Apr 6, 2017

Looking at this with a fresh perspective, I think it might be best to add outputRaw(defaulting to false) and rawPostfix (defaulting to "Raw") options, so a user could set it to something that doesn't conflict with their existing bundle parts.

@PlasmaPower
Copy link
Contributor

I'm working on this again.

@PlasmaPower
Copy link
Contributor

PR created! #96

@nathanwoulfe
Copy link

Champion.

@PlasmaPower
Copy link
Contributor

Would someone mind testing out my branch and see if it works for you? Since the PR doesn't seem to be getting much attention, I'd like some feedback.

@nathanwoulfe
Copy link

Off work this week, will have a look when I'm back. Sounds like exactly what I needed though, so thanks in advance.

@chmontgomery
Copy link
Contributor

just published in version 2.28.0. Let me know how it looks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants