feat(compiler-sfc): export dependencies for css and css preprocessors (#1278)
This commit is contained in:
@@ -1,9 +1,14 @@
|
||||
/**
|
||||
* @jest-environment node
|
||||
*/
|
||||
|
||||
import {
|
||||
compileStyle,
|
||||
compileStyleAsync,
|
||||
SFCStyleCompileOptions
|
||||
} from '../src/compileStyle'
|
||||
import { mockWarn } from '@vue/shared'
|
||||
import path from 'path'
|
||||
|
||||
describe('SFC scoped CSS', () => {
|
||||
mockWarn()
|
||||
@@ -318,3 +323,20 @@ describe('SFC CSS modules', () => {
|
||||
expect(result.modules!.bazQux).toBeUndefined()
|
||||
})
|
||||
})
|
||||
|
||||
describe('SFC style preprocessors', () => {
|
||||
test('scss @import', () => {
|
||||
const res = compileStyle({
|
||||
source: `
|
||||
@import "./import.scss";
|
||||
`,
|
||||
filename: path.resolve(__dirname, './fixture/test.scss'),
|
||||
id: '',
|
||||
preprocessLang: 'scss'
|
||||
})
|
||||
|
||||
expect([...res.dependencies]).toStrictEqual([
|
||||
path.join(__dirname, './fixture/import.scss')
|
||||
])
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user