-
-
Notifications
You must be signed in to change notification settings - Fork 6.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(css): support sass compiler api and sass-embedded package (#17754)
- Loading branch information
Showing
8 changed files
with
384 additions
and
11 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
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
1 change: 1 addition & 0 deletions
1
playground/css/__tests__/sass-modern-compiler/sass-modern-compiler.spec.ts
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 @@ | ||
import '../css.spec' |
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,31 @@ | ||
import { defineConfig } from 'vite' | ||
import baseConfig from './vite.config.js' | ||
|
||
export default defineConfig({ | ||
...baseConfig, | ||
css: { | ||
...baseConfig.css, | ||
preprocessorOptions: { | ||
...baseConfig.css.preprocessorOptions, | ||
scss: { | ||
api: 'modern-compiler', | ||
additionalData: `$injectedColor: orange;`, | ||
importers: [ | ||
{ | ||
canonicalize(url) { | ||
return url === 'virtual-dep' | ||
? new URL('custom-importer:virtual-dep') | ||
: null | ||
}, | ||
load() { | ||
return { | ||
contents: ``, | ||
syntax: 'scss', | ||
} | ||
}, | ||
}, | ||
], | ||
}, | ||
}, | ||
}, | ||
}) |
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
Oops, something went wrong.