Skip to content

build: Angular2App is now a class, and accepts a set of options for SCSS #412

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 2 commits into from
Apr 9, 2016

Conversation

hansl
Copy link
Contributor

@hansl hansl commented Apr 8, 2016

The majority of the Angular2App changes are moving the code up and changing the reference to sourceDir to an option.

@hansl hansl changed the title build: Angular2App is now a class, and accepts a set of options for S… build: Angular2App is now a class, and accepts a set of options for SCSS Apr 8, 2016
@hansl
Copy link
Contributor Author

hansl commented Apr 8, 2016

This would allow people to use something different than src/client by default. This will also allow people to use two apps in their repository by having different destination directories.

file: fileName,
outFile: outFileName,
includePaths: [inputPath].concat(this.options.additionalPaths || [])
};

Copy link
Contributor

Choose a reason for hiding this comment

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

You could do here:

let sassOptions = {
  file: fileName,
  outFile: outFileName,
  includePaths: [inputPath].concat(this.options.additionalPaths || [])
};

sassOptions = Object.assign(sassOptions, this.options);

since there are many other options that can be set (examples).

What do you think?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done, but removed additionalPaths and copySources.

if (less) {
let lessSrcTree = new Funnel(sourceDir, {
include: ['**/*.less'],
allowEmpty: true
});

return new LESSPlugin([lessSrcTree]);
return new LESSPlugin([lessSrcTree], options);
}
};
Copy link
Contributor

Choose a reason for hiding this comment

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

You could also add additional options same as you did for sass. And then call it;
less.render(content, this.options).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

if (stylus) {
let stylusSrcTree = new Funnel(sourceDir, {
include: ['**/*.styl'],
allowEmpty: true
});

return new StylusPlugin([stylusSrcTree]);
return new StylusPlugin([stylusSrcTree], options);
}
};
Copy link
Contributor

Choose a reason for hiding this comment

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

Same as less and then call stylus.render(content, this.options, function(err, css) { ..
Please be careful here, this.options should have filename defined.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yup

@hansl hansl force-pushed the angular2-app branch 4 times, most recently from 86115a3 to 8152724 Compare April 9, 2016 00:49
@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
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants