Commit 567d981e authored by Dan Abramov's avatar Dan Abramov Committed by GitHub
Browse files

Fix external CSS imports (#2680)

* Fix external CSS imports

* Add external CSS import to integration test

* Fix assertion
parent 7b5a589f
Showing with 16 additions and 0 deletions
+16 -0
...@@ -219,6 +219,9 @@ module.exports = { ...@@ -219,6 +219,9 @@ module.exports = {
{ {
loader: require.resolve('postcss-loader'), loader: require.resolve('postcss-loader'),
options: { options: {
// Necessary for external CSS imports to work
// https://github.com/facebookincubator/create-react-app/issues/2677
ident: 'postcss',
plugins: () => [ plugins: () => [
require('postcss-flexbugs-fixes'), require('postcss-flexbugs-fixes'),
autoprefixer({ autoprefixer({
......
...@@ -228,6 +228,9 @@ module.exports = { ...@@ -228,6 +228,9 @@ module.exports = {
{ {
loader: require.resolve('postcss-loader'), loader: require.resolve('postcss-loader'),
options: { options: {
// Necessary for external CSS imports to work
// https://github.com/facebookincubator/create-react-app/issues/2677
ident: 'postcss',
plugins: () => [ plugins: () => [
require('postcss-flexbugs-fixes'), require('postcss-flexbugs-fixes'),
autoprefixer({ autoprefixer({
......
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
"chai": "3.5.0", "chai": "3.5.0",
"jsdom": "9.8.3", "jsdom": "9.8.3",
"mocha": "3.2.0", "mocha": "3.2.0",
"normalize.css": "7.0.0",
"prop-types": "15.5.6", "prop-types": "15.5.6",
"test-integrity": "1.0.0" "test-integrity": "1.0.0"
} }
......
...@@ -17,6 +17,9 @@ describe('Integration', () => { ...@@ -17,6 +17,9 @@ describe('Integration', () => {
expect( expect(
doc.getElementsByTagName('style')[0].textContent.replace(/\s/g, '') doc.getElementsByTagName('style')[0].textContent.replace(/\s/g, '')
).to.match(/html\{/);
expect(
doc.getElementsByTagName('style')[1].textContent.replace(/\s/g, '')
).to.match(/#feature-css-inclusion\{background:.+;color:.+}/); ).to.match(/#feature-css-inclusion\{background:.+;color:.+}/);
}); });
......
/*
* Ensure CSS inclusion doesn't regress
* https://github.com/facebookincubator/create-react-app/issues/2677
*/
@import '~normalize.css/normalize.css';
#feature-css-inclusion { #feature-css-inclusion {
background: palevioletred; background: palevioletred;
color: papayawhip; color: papayawhip;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment