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

Missing dependencies in code example for 3rd party dependencies #105

Open
rajasegar opened this issue Jun 18, 2019 · 0 comments · May be fixed by #106
Open

Missing dependencies in code example for 3rd party dependencies #105

rajasegar opened this issue Jun 18, 2019 · 0 comments · May be fixed by #106

Comments

@rajasegar
Copy link

Under Addon Authors guide, for Third Party Dependencies,
We need to include Funnel and mergeTrees dependencies

CURRENT

var map = require('broccoli-stew').map;

treeForVendor(defaultTree) {
  var browserVendorLib = new Funnel(<path to your third party lib>);

  browserVendorLib = map(browserVendorLib, (content) => `if (typeof FastBoot === 'undefined') { ${content} }`);

  return new mergeTrees([defaultTree, browserVendorLib]);
}

included() {
  // this file will be loaded in FastBoot but will not be eval'd
  app.import('vendor/<third party lib file name>.js');
}

EXPECTED

var map = require('broccoli-stew').map;
var Funnel = require('broccoli-funnel');
var mergeTrees = require('broccoli-merge-trees');

treeForVendor(defaultTree) {
  var browserVendorLib = new Funnel(<path to your third party lib>);

  browserVendorLib = map(browserVendorLib, (content) => `if (typeof FastBoot === 'undefined') { ${content} }`);

  return new mergeTrees([defaultTree, browserVendorLib]);
}

included() {
  // this file will be loaded in FastBoot but will not be eval'd
  app.import('vendor/<third party lib file name>.js');
}

Example code referred from
https://github.com/soulim/ember-cli-bootstrap-datepicker/pull/100/files#diff-168726dbe96b3ce427e7fedce31bb0bcR7

rajasegar pushed a commit to rajasegar/fastboot-website that referenced this issue Jun 18, 2019
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

Successfully merging a pull request may close this issue.

1 participant