Skip to content

chore: remove deprecated node-sass #6090

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 1 commit into from
Dec 2, 2020
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
9 changes: 0 additions & 9 deletions packages/@vue/cli-service/__tests__/generator.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,6 @@ test('sass (default)', async () => {
expect(pkg).toHaveProperty(['devDependencies', 'sass'])
})

test('node sass', async () => {
const { pkg, files } = await generateWithOptions({
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 generateWithOptions({
cssPreprocessor: 'dart-sass'
Expand Down
4 changes: 0 additions & 4 deletions packages/@vue/cli-service/generator/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,6 @@ module.exports = (api, options) => {
sass: '^1.26.5',
'sass-loader': '^8.0.2'
},
'node-sass': {
'node-sass': '^4.12.0',
'sass-loader': '^8.0.2'
},
'dart-sass': {
sass: '^1.26.5',
'sass-loader': '^8.0.2'
Expand Down
2 changes: 1 addition & 1 deletion packages/@vue/cli/lib/options.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ const presetSchema = createSchema((joi) =>
}),
cssPreprocessor: joi
.string()
.valid('sass', 'dart-sass', 'node-sass', 'less', 'stylus'),
.valid('sass', 'dart-sass', 'less', 'stylus'),
plugins: joi.object().required(),
configs: joi.object()
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ test('CSS pre-processor ', async () => {
},
{
message: 'Pick a CSS pre-processor',
choices: ['Sass/SCSS (with dart-sass)', 'Sass/SCSS (with node-sass)', 'Less', 'Stylus'],
choices: ['Sass/SCSS (with dart-sass)', 'Less', 'Stylus'],
choose: 0
}
]
Expand Down
8 changes: 0 additions & 8 deletions packages/@vue/cli/lib/promptModules/cssPreprocessors.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,10 @@ module.exports = cli => {
message: `Pick a CSS pre-processor${process.env.VUE_CLI_API_MODE ? '' : ` (${notice})`}:`,
description: `${notice}.`,
choices: [
// In Vue CLI <= 3.3, the value of Sass option in 'sass' an means 'node-sass'.
// Considering the 'sass' package on NPM is actually for Dart Sass, we renamed it to 'node-sass'.
// In @vue/cli-service there're still codes that accepts 'sass' as an option value, for compatibility reasons,
// and they're meant to be removed in v4.
{
name: 'Sass/SCSS (with dart-sass)',
value: 'dart-sass'
},
{
name: 'Sass/SCSS (with node-sass)',
value: 'node-sass'
},
{
name: 'Less',
value: 'less'
Expand Down
2 changes: 1 addition & 1 deletion packages/@vue/cli/lib/util/ProjectPackageManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ class PackageManager {
}

try {
// node-sass, chromedriver, etc.
// chromedriver, etc.
const binaryMirrorConfigMetadata = await this.getMetadata('binary-mirror-config', { full: true })
const latest = binaryMirrorConfigMetadata['dist-tags'] && binaryMirrorConfigMetadata['dist-tags'].latest
const mirrors = binaryMirrorConfigMetadata.versions[latest].mirrors.china
Expand Down
2 changes: 0 additions & 2 deletions packages/@vue/cli/lib/util/inferRootOptions.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@ module.exports = function inferRootOptions (pkg) {
// cssPreprocessors
if ('sass' in deps) {
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
4 changes: 0 additions & 4 deletions packages/@vue/cli/types/cli-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,6 @@ const testPromptAPI = (cli: PromptModuleAPI) => {
name: 'Sass/SCSS (with dart-sass)',
value: 'dart-sass'
},
{
name: 'Sass/SCSS (with node-sass)',
value: 'node-sass'
},
{
name: 'Less',
value: 'less'
Expand Down
2 changes: 1 addition & 1 deletion packages/@vue/cli/types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ type Preset = Partial<{
useConfigFiles: boolean
plugins: Record<string, any>
configs: Record<string, any>
cssPreprocessor: 'sass' | 'dart-sass' | 'node-sass' | 'less' | 'stylus'
cssPreprocessor: 'sass' | 'dart-sass' | 'less' | 'stylus'
}>

declare class PromptModuleAPI {
Expand Down