Skip to content

css preprocessor plugins #388

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

Merged
merged 7 commits into from
Apr 5, 2016
Merged

css preprocessor plugins #388

merged 7 commits into from
Apr 5, 2016

Conversation

jkuri
Copy link
Contributor

@jkuri jkuri commented Apr 2, 2016

No description provided.

@jkuri jkuri added the feature Issue that requests a new feature label Apr 2, 2016

options = options || {};
Plugin.call(this, inputNodes, {
cacheInclude: [/(.*?).scss$/, /(.*?).sass$/]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't it be \.scss and \.sass ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And the ? isn't necessary afaict.

@jkuri
Copy link
Contributor Author

jkuri commented Apr 3, 2016

Updated, thanks for checking @gkalpak.

it('Installs sass support successfully via `ng install sass`', function() {
this.timeout(420000);

sh.exec('npm install node-sass', { silent: true });
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not familiar with the project's conventions, but should this be ng install sass ?
(If not, the test description is kind of inaccurate.)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @gkalpak. I need to update the description, you are right. We abandoned the ng install command for now.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jkuri, I didn't know about ng install 😃
I try to follow along, but you are moving too fast 👍

@jkuri jkuri force-pushed the css-support branch 2 times, most recently from bbd9a14 to 3fa1f6f Compare April 4, 2016 01:31

return new CompassPlugin([compassSrcTree]);
} else {
return;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not necessary.

@jkuri jkuri force-pushed the css-support branch 2 times, most recently from 66545d6 to 19a1762 Compare April 4, 2016 04:43
sass = require('sass');
compass = require('compass');
} catch (e) {
sass = require(`${process.env.PROJECT_ROOT}/node_modules/node-sass`);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If ${process.env.PROJECT_ROOT}/node_modules/node-sass exists, wouldn't require('sass') have picked it up ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunately not.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You cannot require peer dependencies without having a peerDependency key in package.json. We could put it there as optional. We need to experiment on this.

@jkuri
Copy link
Contributor Author

jkuri commented Apr 4, 2016

Updated, @hansl and @gkalpak please take a look.


compile(fileName, inputPath, outputPath) {
let sassOptions = {
file: path.join(fileName),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

path.join --> path.normalize

@gkalpak
Copy link
Member

gkalpak commented Apr 4, 2016

I'm not familiar with compass tbh, but I wonder what happens if both node-sass and compass-importer are installed. Won't both SASSPlugin and CompassPlugin be trying to convert those .s[ac]ss files ?
What will happen ? Overwrite each others output ?

@hansl
Copy link
Contributor

hansl commented Apr 5, 2016

If you have both installed, one of them will take precendence. If you have a custom workflow you should have a custom broccoli configuration anyway.

@jkuri LGTM.

@jkuri
Copy link
Contributor Author

jkuri commented Apr 5, 2016

Thanks Hans.

@gkalpak
Copy link
Member

gkalpak commented Apr 5, 2016

But if SASSPlugin always takes precedence over CompassPlugin, doesn't it mean that the latter is effectively not supported ?

@jkuri
Copy link
Contributor Author

jkuri commented Apr 5, 2016

@gkalpak I am fixing that.

@jkuri jkuri force-pushed the css-support branch 2 times, most recently from 21ce9c9 to 3501010 Compare April 5, 2016 18:12
@jkuri jkuri merged commit bf1f762 into angular:master Apr 5, 2016
@jkuri jkuri deleted the css-support branch April 5, 2016 20:26
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 9, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature Issue that requests a new feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants