-
-
Notifications
You must be signed in to change notification settings - Fork 79
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: add unmountable CSS example (#528)
- Loading branch information
Showing
6 changed files
with
60 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
body.this-class-is-for-e2e-testing { | ||
background-color: red; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
const singleSpaConfig = require('../../lib/lib/webpack'); | ||
|
||
module.exports = (config, options) => { | ||
config = singleSpaConfig.default(config, options); | ||
|
||
// https://github.com/angular/angular-cli/blob/b65ef44cbe36416271521eba0ba5fc0b4442af55/packages/angular_devkit/build_angular/src/tools/webpack/configs/styles.ts#L235-L255 | ||
const scssRule = config.module.rules.find(rule => rule.test.toString().includes('scss')).rules[0]; | ||
|
||
scssRule.oneOf.unshift({ | ||
resourceQuery: /\?unmountable/, | ||
use: [ | ||
{ | ||
loader: 'style-loader', | ||
options: { | ||
injectType: 'lazySingletonStyleTag', | ||
}, | ||
}, | ||
// Take the other loaders that Angular uses internally. | ||
// Since we replaced the `mini-css-extract-plugin` loader with the | ||
// `style-loader` (which is at index 0), we slice the list by 1 index. | ||
...scssRule.oneOf[0].use.slice(1), | ||
], | ||
}); | ||
|
||
return config; | ||
}; |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters