mirror of
https://github.com/vuejs/vue-cli.git
synced 2026-02-12 09:58:29 -06:00
BREAKING CHANGE: Preset generated before v3.4.0 may contain a `"cssPreprocessor": "sass"` field. It now means dart-sass rather than node-sass. `rootOptions.cssPreprocessor === 'sass'` now also means dart sass. May affect those generator plugins who depends on this field
47 lines
1.1 KiB
JavaScript
47 lines
1.1 KiB
JavaScript
const generateWithPlugin = require('@vue/cli-test-utils/generateWithPlugin')
|
|
|
|
test('sass (default)', async () => {
|
|
const { pkg, files } = await generateWithPlugin([
|
|
{
|
|
id: '@vue/cli-service',
|
|
apply: require('../generator'),
|
|
options: {
|
|
cssPreprocessor: 'sass'
|
|
}
|
|
}
|
|
])
|
|
|
|
expect(files['src/App.vue']).toMatch('<style lang="scss">')
|
|
expect(pkg).toHaveProperty(['devDependencies', 'sass'])
|
|
})
|
|
|
|
test('node sass', async () => {
|
|
const { pkg, files } = await generateWithPlugin([
|
|
{
|
|
id: '@vue/cli-service',
|
|
apply: require('../generator'),
|
|
options: {
|
|
cssPreprocessor: 'node-sass'
|
|
}
|
|
}
|
|
])
|
|
|
|
expect(files['src/App.vue']).toMatch('<style lang="scss">')
|
|
expect(pkg).toHaveProperty(['devDependencies', 'node-sass'])
|
|
})
|
|
|
|
test('dart sass', async () => {
|
|
const { pkg, files } = await generateWithPlugin([
|
|
{
|
|
id: '@vue/cli-service',
|
|
apply: require('../generator'),
|
|
options: {
|
|
cssPreprocessor: 'dart-sass'
|
|
}
|
|
}
|
|
])
|
|
|
|
expect(files['src/App.vue']).toMatch('<style lang="scss">')
|
|
expect(pkg).toHaveProperty(['devDependencies', 'sass'])
|
|
})
|