Skip to content

chore!: default to dart sass for sass option of cssPreprocessor #3921

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 30, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions packages/@vue/cli-service/__tests__/generator.spec.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const generateWithPlugin = require('@vue/cli-test-utils/generateWithPlugin')

test('node sass (legacy)', async () => {
test('sass (default)', async () => {
const { pkg, files } = await generateWithPlugin([
{
id: '@vue/cli-service',
Expand All @@ -12,7 +12,7 @@ test('node sass (legacy)', async () => {
])

expect(files['src/App.vue']).toMatch('<style lang="scss">')
expect(pkg).toHaveProperty(['devDependencies', 'node-sass'])
expect(pkg).toHaveProperty(['devDependencies', 'sass'])
})

test('node sass', async () => {
Expand Down
5 changes: 2 additions & 3 deletions packages/@vue/cli-service/generator/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,12 @@ module.exports = (api, options) => {

if (options.cssPreprocessor) {
const deps = {
// TODO: remove 'sass' option in v4 or rename 'dart-sass' to 'sass'
sass: {
'node-sass': '^4.9.0',
sass: '^1.19.0',
'sass-loader': '^7.1.0'
},
'node-sass': {
'node-sass': '^4.9.0',
'node-sass': '^4.12.0',
'sass-loader': '^7.1.0'
},
'dart-sass': {
Expand Down
1 change: 0 additions & 1 deletion packages/@vue/cli/lib/options.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ const presetSchema = createSchema(joi => joi.object().keys({
router: joi.boolean(),
routerHistoryMode: joi.boolean(),
vuex: joi.boolean(),
// TODO: remove 'sass' or make it equivalent to 'dart-sass' in v4
cssPreprocessor: joi.string().only(['sass', 'dart-sass', 'node-sass', 'less', 'stylus']),
plugins: joi.object().required(),
configs: joi.object()
Expand Down
5 changes: 2 additions & 3 deletions packages/@vue/cli/lib/util/inferRootOptions.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,9 @@ module.exports = function inferRootOptions (pkg) {

// cssPreprocessors
if ('sass' in deps) {
rootOptions.cssPreprocessor = 'dart-sass'
} else if ('node-sass' in deps) {
// TODO: change to 'node-sass' in v4
rootOptions.cssPreprocessor = 'sass'
} else if ('node-sass' in deps) {
rootOptions.cssPreprocessor = 'node-sass'
} else if ('less-loader' in deps) {
rootOptions.cssPreprocessor = 'less'
} else if ('stylus-loader' in deps) {
Expand Down