Skip to content

Add npm run analyze command#261

Merged
mxstbr merged 5 commits intov3.0.0from
feature/analyze
Apr 17, 2016
Merged

Add npm run analyze command#261
mxstbr merged 5 commits intov3.0.0from
feature/analyze

Conversation

@oliverturner
Copy link
Copy Markdown
Collaborator

Not as elegant as it might be, but generates a stats.json from a productionised build and opens a browser to the webpack analyser ready for the user to upload.

Needs some instructions output to the terminal on completion...

@coveralls
Copy link
Copy Markdown

Coverage Status

Coverage remained the same at 99.206% when pulling 1f0acd3 on feature/analyze into 681d6fe on v3.0.0.

@mxstbr
Copy link
Copy Markdown
Member

mxstbr commented Apr 6, 2016

This is good first step, but I'd make this a script and log some output after finishing the build. Can take a look at this!

@mxstbr
Copy link
Copy Markdown
Member

mxstbr commented Apr 7, 2016

Just took a look, is there a reason we aren't using https://github.com/chrisbateman/webpack-visualizer?

Since it's a webpack plugin, instead of having to upload a huge JSON file somewhere it generates a visualization .html file one can simply open locally in the browser. I think that's preferable, especially for bigger applications, but I might be missing something?

@oliverturner
Copy link
Copy Markdown
Collaborator Author

Well, I'm always looking for ways to avoid thrusting yet another dependency on users, and it's not the actually the case that you upload anything (since the code runs client-side) but mainly it's that it doesn't give the level of insight that the Webpack analyzer does.

@webdesserts
Copy link
Copy Markdown
Contributor

I will say that I've had to setup the project multiple times in the last few days and the npm installs sometimes run ~5minutes at times. Since this isn't exactly a need to have feature, reduced dependencies would be a nice bonus from my point of view.

@mxstbr
Copy link
Copy Markdown
Member

mxstbr commented Apr 13, 2016

Fair enough, I'm convinced! I'll add a bit of documentation about this feature in the commands.md and merge it in!

@coveralls
Copy link
Copy Markdown

Coverage Status

Coverage increased (+0.01%) to 99.218% when pulling 306614c on feature/analyze into 64adb5f on v3.0.0.

@mxstbr
Copy link
Copy Markdown
Member

mxstbr commented Apr 13, 2016

Alright, I think this is ready to merge – I'd appreciate if somebody could try running it on Windows (we should highlight our amazing OS compatibility in the README btw @oliverturner) but I'm 99% sure it works.

I added documentation, gave it nicer output and instead of opening the link in the default browser (which I think only works on OSX) I output the link like so:

screen shot 2016-04-13 at 11 20 09

I'm aware the keyboard-shortcut-trick only works on OSX in the default terminal, but it's CMD-Click in iTerm so that'll work too and on Windows I'm pretty sure people will figure it out themselves

@coveralls
Copy link
Copy Markdown

Coverage Status

Coverage remained the same at 99.218% when pulling cb94775 on feature/analyze into 9ec10b5 on v3.0.0.

@oliverturner oliverturner self-assigned this Apr 13, 2016
@mxstbr mxstbr changed the title Addresses #203 Add npm run analyze command Apr 13, 2016
@mxstbr mxstbr merged commit a37bad2 into v3.0.0 Apr 17, 2016
@mxstbr mxstbr deleted the feature/analyze branch April 17, 2016 17:33
@lock
Copy link
Copy Markdown

lock bot commented May 30, 2018

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators May 30, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants