-
Notifications
You must be signed in to change notification settings - Fork 12k
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
Conversation
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 })}`, |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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()', |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
cd6bd7f
to
e956d2c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
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
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
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
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
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
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
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Fix #4285