livingstyleguide / broccoli-livingstyleguide

The official Broccoli plugin for the LivingStyleGuide
https://twitter.com/LSGorg
Other
22 stars 2 forks source link

Updated Docs #2

Closed mastastealth closed 9 years ago

mastastealth commented 9 years ago

Trying to get this working on Ember CLI, with Ember 1.13.1 but I'm having trouble with the documentation:

/* global require, module */
var EmberApp = require('ember-cli/lib/broccoli/ember-app');

module.exports = function(defaults) {
  var app = new EmberApp(defaults, {
    // options
  });

  return app.toTree();
};

I imagine the follow 2 can just go under the first line:

var EmberApp = require('ember-cli/lib/broccoli/ember-app');
var LivingStyleGuide = require('broccoli-livingstyleguide');
var lsg = LivingStyleGuide(['app'], 'styles/styleguide.lsg', 'assets/styleguide.html');

but then where do I stick in module.exports = mergeTrees([app.toTree(), lsg]); ?

hagenburger commented 9 years ago

Hey Brian, I need to find out myself as I haven’t been working with the latest Ember versions yet. I’m organizing a conference on the weekend so it might be difficult to find an answer for you in time. Let me know, if you found out anything yourself first.

mydea commented 9 years ago

I got it to work by manually installing broccoli-merge-trees via npm, and then doing something like this in ember-cli-build.js:

var EmberApp = require('ember-cli/lib/broccoli/ember-app');
var mergeTrees = require('broccoli-merge-trees');
var LivingStyleGuide = require('broccoli-livingstyleguide');

var lsg = LivingStyleGuide(['app'], 'styles/styleguide.lsg', 'assets/styleguide.html');

module.exports = function (defaults) {
    var app = new EmberApp(defaults, {
        // Add options here
    });

    return mergeTrees([app.toTree(), lsg]);
};
hagenburger commented 9 years ago

@mastastealth I hope this solves it for you. Reopen if not.

@mydea thank you! I think we should add your code to the README. What do you think?