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

reduce file size #177

Open
macrozone opened this issue May 18, 2017 · 7 comments
Open

reduce file size #177

macrozone opened this issue May 18, 2017 · 7 comments

Comments

@macrozone
Copy link

with meteor 1.5. and the new bundle-analyizer you get a good picture of the bundle size.

This library is huge (166kb) and contributes to 10% of the file size. Is it possible to reduce file size? we only need google analytics.

okgrow:analytics version 2.1.1

@macrozone
Copy link
Author

maybe we can use something like meteor/meteor#8745 ?

@jlichti
Copy link

jlichti commented Jun 22, 2017

The library also seems to pull in meteor-node-stubs for me which adds another 300kb.
I'm testing and reduced my bundle by about 600kb without okgrow:analytics.

@Floriferous
Copy link

@jlichti Just realised it is indeed this package that pulls in meteor-node-stubs, did you figure out why?

Got the same bundle-size reduction as you when removing it, huge!

@jlichti
Copy link

jlichti commented Jul 16, 2017

I didn't dig into it since it was easy for me to just replace with a npm package.

@Floriferous
Copy link

Which package did you use, and did it do any sort of automatic logging?

@jlichti
Copy link

jlichti commented Jul 24, 2017

I used this package: https://github.com/react-ga/react-ga

I'm using flow router on this project so I added a trigger:
FlowRouter.triggers.enter((context, redirect) => { logPageView(); ... });

And my logPageView() method is:
const logPageView = () => { ReactGA.set({ page: window.location.pathname + window.location.search }); ReactGA.pageview(window.location.pathname + window.location.search); };

@RobertLowe
Copy link
Contributor

Cross ref: meteor/node-stubs#6

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

5 participants