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

feat(@angular/cli): allow component css imports #4667

Merged
merged 1 commit into from
Feb 14, 2017

Conversation

filipesilva
Copy link
Contributor

Fix #4285

const commonLoaders = [
// css-loader doesn't support webpack.LoaderOptionsPlugin properly,
// so we need to add options in its query
`css-loader?${JSON.stringify({ sourceMap: cssSourceMap })}`,
Copy link
Member

Choose a reason for hiding this comment

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

Adding importLoaders=1 to css-loader's options will allow any imports it handles to be processed by the PostCSS pipeline.

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


// load component css as raw strings
let rules: any = baseRules.map(({test, loaders}) => ({
exclude: globalStylePaths, test, loaders: ['raw-loader', ...commonLoaders, ...loaders]
exclude: globalStylePaths, test, loaders: [
'exports-loader?module.exports.toString()',
Copy link
Member

Choose a reason for hiding this comment

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

You'll need a comment with require('exports-loader') at the top of the file with the others.

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

@filipesilva filipesilva force-pushed the fix-component-imports branch from cd6bd7f to e956d2c Compare February 13, 2017 16:01
@filipesilva filipesilva assigned hansl and Brocco and unassigned hansl and Brocco Feb 13, 2017
@filipesilva filipesilva requested review from hansl and Brocco February 13, 2017 16:22
Copy link
Contributor

@hansl hansl left a comment

Choose a reason for hiding this comment

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

LGTM

@hansl hansl merged commit e55cb82 into angular:master Feb 14, 2017
filipesilva added a commit to filipesilva/angular-cli that referenced this pull request Feb 17, 2017
Fixing component css in angular#4667 uncovered errors in CSS url processing.

This PR correctly composes absolute urls when using `--base-href` and/or `--deploy-url`.

Fix angular#4778
Fix angular#4782
filipesilva added a commit to filipesilva/angular-cli that referenced this pull request Feb 17, 2017
Fixing component css in angular#4667 uncovered errors in CSS url processing.

This PR correctly composes absolute urls when using `--base-href` and/or `--deploy-url`.

Fix angular#4778
Fix angular#4782
filipesilva added a commit to filipesilva/angular-cli that referenced this pull request Feb 18, 2017
Fixing component css in angular#4667 uncovered errors in CSS url processing.

This PR correctly composes absolute urls when using `--base-href` and/or `--deploy-url`.

Fix angular#4778
Fix angular#4782
filipesilva added a commit to filipesilva/angular-cli that referenced this pull request Feb 18, 2017
Fixing component css in angular#4667 uncovered errors in CSS url processing.

This PR correctly composes absolute urls when using `--base-href` and/or `--deploy-url`.

Fix angular#4778
Fix angular#4782
filipesilva added a commit to filipesilva/angular-cli that referenced this pull request Feb 20, 2017
Fixing component css in angular#4667 uncovered errors in CSS url processing.

This PR correctly composes absolute urls when using `--base-href` and/or `--deploy-url`.

It also fixes asset output on `--aot` mode.

Fix angular#4778
Fix angular#4782
Fix angular#4806
filipesilva added a commit that referenced this pull request Feb 20, 2017
Fixing component css in #4667 uncovered errors in CSS url processing.

This PR correctly composes absolute urls when using `--base-href` and/or `--deploy-url`.

It also fixes asset output on `--aot` mode.

Fix #4778
Fix #4782
Fix #4806
@filipesilva filipesilva deleted the fix-component-imports branch February 25, 2017 11:27
asnowwolf pushed a commit to asnowwolf/angular-cli that referenced this pull request Apr 12, 2017
asnowwolf pushed a commit to asnowwolf/angular-cli that referenced this pull request Apr 12, 2017
Fixing component css in angular#4667 uncovered errors in CSS url processing.

This PR correctly composes absolute urls when using `--base-href` and/or `--deploy-url`.

It also fixes asset output on `--aot` mode.

Fix angular#4778
Fix angular#4782
Fix angular#4806
@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 11, 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.

CSS imports do not work for component CSS
5 participants