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

final production build include full ember-data-factory-guy library in vendor.js #140

Closed
junos opened this issue Oct 15, 2015 · 13 comments
Closed

Comments

@junos
Copy link

junos commented Oct 15, 2015

The issue is: we need to get rid of "ember-data-factory-guy" library in vendor.js for production build.

Steps to re-production the issue:

  1. add "ember-data-factory-guy" in package.json devDenendencies
  2. npm install
  3. import '"ember-data-factory-guy" in our test js file
  4. excute ember cli build command in production mode
  5. in vendor.js file, it include the full package of "ember-data-factory-guy"
@danielspaniel
Copy link
Collaborator

@junos .. why are you adding factory guy to devDependencies?
why don't you -> ember install ember-data-factory-guy?
does that still include it in vendor.js ? it should not. no?

@junos
Copy link
Author

junos commented Oct 15, 2015

It still don't work for me.

This is what I did:

  1. clean bower cache, clean npm cache
  2. rm -rf node_modules bower_components dist tmp
  3. npm install
  4. bower install
  5. ember install ember-data-factory-guy
  6. ember build --environment production
    after these, vendor.js still include ember-data-factory-guy code

@danielspaniel
Copy link
Collaborator

why is this an issue .. ?? curious

@junos
Copy link
Author

junos commented Oct 15, 2015

  1. We don't want any test packages (which are never used) in production release.
  2. To exclude these test packages, it will minimize size of vendor.js and improve the page loading time.
  3. curious why ember-data-factory-guy behave differently with other js libraries.

@danielspaniel
Copy link
Collaborator

some addons like ember-cli-qunit install bower components ember-qunit, qunit .. etc
some addons don't .. since they are just addons ( and not specifically test addons )
I agree that it would be great to exclude it ..
and I think what I would have to do is to make a bower build and include that when someone installs factory guy
is there another addon that is able to exclude itself from production vendor.js that you know of ?

@junos
Copy link
Author

junos commented Oct 15, 2015

For example, ember-sinon, could you define your package type as 'test'? so it only included in test dependances, https://github.com/csantero/ember-sinon/blob/master/index.js#L10

or other solutions like that.

@danielspaniel
Copy link
Collaborator

right .. ember-sinon like ember-qunit both install the bower packages ( sinon and qunit and ember-qunit ( they made a bower package for ember-qunit )
I think the answer is to do like ember or ember-data and install factory as bower component the way these do for now .. till ember-cli supports this sort of thing the way rails does .. asset groups
but I can't do it right now .. next week I can work on it when I do a few other upgrades

@danielspaniel
Copy link
Collaborator

can you open an issue on the ember-cli repo stating this very issue .. I think it's a good one

@junos
Copy link
Author

junos commented Oct 26, 2015

OK, do you think this help? I file a ticket here: ember-cli/ember-cli#4993

@danielspaniel
Copy link
Collaborator

yes, that helps .. thanks .. I will check out treeForTestSupport and see if that does it.

@danielspaniel
Copy link
Collaborator

Also, this might be a nice thing to try to get working ( make a branch .. and try to get it working as you want and submit as pull request ).

@afn
Copy link
Contributor

afn commented Dec 2, 2015

Any update on this issue?

@danielspaniel
Copy link
Collaborator

I was hoping you would help fix it? Any interest?

afn pushed a commit to amitree/ember-data-factory-guy that referenced this issue Dec 16, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants