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

Addons sass files aren't compiled #78

Closed
vitch opened this issue Jul 15, 2015 · 2 comments
Closed

Addons sass files aren't compiled #78

vitch opened this issue Jul 15, 2015 · 2 comments

Comments

@vitch
Copy link

vitch commented Jul 15, 2015

I am generating an addon which relies on ember-component-css. I would like to be able to generate component styles for the components provided by my addon (e.g. the components in addon/pods/components). However, these styles don't seem to be compiled and the component doesn't get it's className adjusted.

I tried adding the scss file to the corresponding file in app/pods/components and this works correctly when developing the addon. When the addon is installed into another app it fails, however.

I came across #54 when investigating and I wasn't clear if this was the same issue?

Is my use-case supported? Is there a way that I can opt into it (maybe merging the relevant files from the addon into the app in treeFor?)?

Thanks!

@vitch
Copy link
Author

vitch commented Jul 16, 2015

I seem to have this working in my addon with the following code:

treeForApp: function(tree) {
  // We need to merge in the styles from our addon back into the app so that they
  // get seen by ember-component-css and compiled
  var addonComponentsDir = 'addon/pods/components/';
  if (!this.isDevelopingAddon()) {
    addonComponentsDir = ['node_modules', this.name, addonComponentsDir].join('/');
  }
  var copiedStylesTree = new Funnel(addonComponentsDir, {
    include: [/\.s?css$/],
    destDir: 'pods/components/'
  });
  return mergeTrees([copiedStylesTree, tree]);;
}

I'm not sure if this should be recommended or considered correct but it's working for me for now....

I'm also sure that there must be a nicer way to get the path to the addon/pods/components directory which doesn't need the special case for when you aren't developing an addon and also works with a different podModulePrefix...

@ebryn
Copy link
Collaborator

ebryn commented Jul 16, 2015

This addon doesn't support usage inside of addons right now and I don't have the time to investigate it at the moment. I believe there were some issues inside of Ember-CLI itself that prevented me from getting it working.

@ebryn ebryn closed this as completed Jul 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

2 participants