ember-fastboot / fastboot-website

http://ember-fastboot.com/
18 stars 49 forks source link

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

Open rajasegar opened 5 years ago

rajasegar commented 5 years ago

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