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

Cannot use addon/styles/addon.scss #56

Closed
artsyca opened this issue May 28, 2015 · 21 comments
Closed

Cannot use addon/styles/addon.scss #56

artsyca opened this issue May 28, 2015 · 21 comments

Comments

@artsyca
Copy link

artsyca commented May 28, 2015

I've followed the instructions in the README for creating an addon with an included addon.scss file, but no matter what I do, the styles are not getting picked up by vendor.css.

Is there anything more we need to know in order to make this work?

AS an aside: addon.css is definitely getting picked up.

@Axxon
Copy link

Axxon commented May 29, 2015

hi @artsyca i've the same issue, could you please compare my repo https://github.com/Axxon/ember-cli-minimal-tree/tree/front2 if a done a mistake ?

@artsyca
Copy link
Author

artsyca commented May 29, 2015

@Axxon : https://github.com/Axxon/ember-cli-minimal-tree/blob/front2/tests/dummy/app/styles/app.css according to the instructions, this should be app.scss but even so it hasn't worked for me..

@Axxon
Copy link

Axxon commented May 29, 2015

@artsyca I tried like you, without success. (i pushed that).

@dukex
Copy link
Collaborator

dukex commented May 29, 2015

I had the same issue here

@Axxon
Copy link

Axxon commented May 30, 2015

So, a cool guy could share me a advise to integrate sass into my addon ?

@fpauser
Copy link

fpauser commented Jun 2, 2015

There seem to be some more issues with ember-cli-sass & ember-cli:
ember-cli/ember-cli#4084
ember-cli/ember-cli#3644
ember-cli/ember-cli#2905 (lists more related issues)

@simonexmachina
Copy link
Collaborator

Thanks @fpauser. Yes there definitely do seem to be issues outside the scope of ember-cli-sass here. Unfortunately I've just joined an early stage startup as a tech co-founder, so I simply do not have a second to look into this, sorry. Luckily the source code's available so I'm happy to review and publish any PRs from the community. I'm also open to adding other collaborators on this project as well if anyone is interested.

@artsyca
Copy link
Author

artsyca commented Jun 3, 2015

Congratulations @aexmachina I wish you all the best.

@fpauser
Copy link

fpauser commented Jun 7, 2015

As it seems the last working version of ember-cli-sass was v4.0.0-beta.5 (discovered it by looking at ember-paper's package.json).

Something in v4.0.0-beta.6 breaks compatibility with ember-addons:
v4.0.0-beta.5...v4.0.0-beta.6

@fpauser
Copy link

fpauser commented Jun 7, 2015

Seems like tryFile() @ https://github.com/aexmachina/ember-cli-sass/blob/master/index.js#L21 is problematic. Unsure if this is really an ember-cli problem or if the scss/sass-check should also deal with the inputTrees.

@dukex
Copy link
Collaborator

dukex commented Jun 8, 2015

SASSPlugin.prototype.toTree to addon:

> inputPath
'/'
> outputPath
'/'
> tree
'/file/to/my/project-addon/addon/styles'

SASSPlugin.prototype.toTree to dummy app:

> inputPath
'/app/styles'
> outputPath
'/assets'
> tree
{ inputTrees:
   [ { inputTrees: [Object],
       options: [Object],
       description: 'TreeMerger (ExternalTree)' },
     { inputTrees: [Object], options: [Object] },
     { inputTrees: [], options: [Object] },
     { inputTrees: [], options: [Object] },
     { inputTrees: [], options: [Object] },
     { inputTrees: [], options: [Object] },
     { inputTrees: [Object], options: [Object] },
     { inputTrees: [], options: [Object] },
     { inputTrees: [], options: [Object] },
     { inputTrees: [], options: [Object] },
     { inputTrees: [], options: [Object] },
     { inputTrees: [Object], options: [Object] },
     { inputTrees: [], options: [Object] },
     { inputTrees: [Object], options: [Object] },
     { inputTrees: [], options: [Object] },
     { inputTrees: [], options: [Object] },
     { inputTrees: [], options: [Object] },
     { inputTree: 'tests/dummy/app/styles',
       _includeFileCache: {},
       _destinationPathCache: {},
       _tmpDir: '/file/to/my/project-addon/tmp/funnel-dest_Hjw6n6.tmp',
       srcDir: '/',
       destDir: '/app/styles',
       destPath: '/file/to/my/project-addon/tmp/funnel-dest_Hjw6n6.tmp/app/styles',
       _instantiatedStack: 'Error\n    at new Funnel (/file/to/my/project-addon/node_modules/... (length: 852)' } ],
  options: { description: 'TreeMerger (stylesAndVendor)', overwrite: true },
  description: 'TreeMerger (stylesAndVendor)' }

There is a problem on tryFile when run the addon tree, inputPath is '/'

@simonexmachina
Copy link
Collaborator

Thanks for the investigation, you were right that that PR introduced the problem. Root cause is the issue above.

I've added an option in v4.0.1 that allows you to specify the file extension, which bypasses the tryFile lookup. So until the underlying issue is resolved you need to specify this option when using inside an addon.

dukex pushed a commit to dukex/ember-cli-sass that referenced this issue Jun 10, 2015
dukex pushed a commit to dukex/ember-cli-sass that referenced this issue Jun 10, 2015
@justin-lau
Copy link

I'm still having issue with v4.0.1 even after having extension set in the addon's Brocfile:

var app = new EmberAddon({
    sassOptions: {
        extension: 'scss',
    },
});

Also followed instructions in the readme for addons usage, but the content of addon/styles/addon.scss is not showing in dist/assets/vendor.css.

Am I missing anything?

@dukex
Copy link
Collaborator

dukex commented Jun 15, 2015

@justin-lau the pull-request #57 will fix your problem

@justin-lau
Copy link

@dukex I thought the extension option was introduced as a temporary workaround to this issue... With your fixed branch I now understand it was actually meant for the scss files in the dummy app. Thanks!

@timohermans
Copy link

Any news on this? I'm actually waiting for the fix, so I'm still on 4.0.0-beta5

@dukex
Copy link
Collaborator

dukex commented Aug 20, 2015

@temo44 We are waiting the pull request #57

@simonexmachina
Copy link
Collaborator

@temo44 you should be able to work around that issue by specifying the extension option.

@lmcardle
Copy link

+1 also having problems getting addon.scss compiling to dist/assets/vendor.css even with specifying:

// ember-cli-build.js
sassOptions: {
    extension: 'scss' // or sass
}

I am currently on 4.2.0

@dukex dukex mentioned this issue Oct 1, 2015
@dukex
Copy link
Collaborator

dukex commented Oct 8, 2015

Hi everyone, given #78 was merged, now with 5.0.0 you can use sass on addon.
I think this issue can be closed

@simonexmachina
Copy link
Collaborator

Be aware that you now need to specify extension option if you're not using .scss

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

8 participants