Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: support importing css with ?raw
- Loading branch information
1 parent
faae331
commit 545ba11
Showing
5 changed files
with
42 additions
and
3 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -356,3 +356,5 @@ test('minify css', async () => { | |
expect(cssFile).toMatch('rgba(') | ||
expect(cssFile).not.toMatch('#ffff00b3') | ||
}) | ||
|
||
|
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,19 @@ | ||
test('?raw', async () => { | ||
const rawImportCss = await page.$('.raw-imported-css'); | ||
const rawImportSass = await page.$('.raw-imported-sass'); | ||
const rawImportLess = await page.$('.raw-imported-less'); | ||
const rawImportStylus = await page.$('.raw-imported-stylus'); | ||
|
||
expect(await rawImportCss.textContent()).toBe( | ||
require('fs').readFileSync(require.resolve('../imported.css'), 'utf-8') | ||
) | ||
expect(await rawImportSass.textContent()).toBe( | ||
require('fs').readFileSync(require.resolve('../sass.scss'), 'utf-8') | ||
) | ||
expect(await rawImportLess.textContent()).toBe( | ||
require('fs').readFileSync(require.resolve('../less.less'), 'utf-8') | ||
) | ||
expect(await rawImportStylus.textContent()).toBe( | ||
require('fs').readFileSync(require.resolve('../stylus.styl'), 'utf-8') | ||
) | ||
}); |
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
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