-
-
Notifications
You must be signed in to change notification settings - Fork 26.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for absolute paths when using url() in CSS (#7937)
* Support scss absolute path resolution for url() Adding resolve-url-loader broke all apps using scss with centralized assets folder and all url(./assets/*.png) broke (#7023). This change allows apps to use url(/assets/*.png) and it would map to src/assets/*.png * test: Add global scss assets test
- Loading branch information
Showing
7 changed files
with
41 additions
and
0 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
Empty file.
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,16 @@ | ||
const testSetup = require('../__shared__/test-setup'); | ||
|
||
if (testSetup.isLocal) { | ||
// TODO: make this work locally | ||
test('skipped locally', () => {}); | ||
} else { | ||
test('builds in development', async () => { | ||
const { fulfilled } = await testSetup.scripts.start({ smoke: true }); | ||
expect(fulfilled).toBe(true); | ||
}); | ||
|
||
test('builds in production', async () => { | ||
const { fulfilled } = await testSetup.scripts.build(); | ||
expect(fulfilled).toBe(true); | ||
}); | ||
} |
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,7 @@ | ||
{ | ||
"dependencies": { | ||
"node-sass": "4.x", | ||
"react": "latest", | ||
"react-dom": "latest" | ||
} | ||
} |
7 changes: 7 additions & 0 deletions
7
test/fixtures/global-scss-asset-resolution/src/images/logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,5 @@ | ||
import React from 'react'; | ||
import ReactDOM from 'react-dom'; | ||
import './index.scss'; | ||
|
||
ReactDOM.render(<div />, document.getElementById('root')); |
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,5 @@ | ||
#root { | ||
width: 300px; | ||
height: 300px; | ||
background: url(/images/logo.svg) center/cover no-repeat; | ||
} |