mirror of
https://github.com/vitejs/vite.git
synced 2024-11-21 14:48:41 +00:00
34 lines
916 B
JavaScript
34 lines
916 B
JavaScript
import path from 'node:path'
|
|
import { pathToFileURL } from 'node:url'
|
|
import { defineConfig } from 'vite'
|
|
import baseConfig from './vite.config.js'
|
|
|
|
export default defineConfig({
|
|
...baseConfig,
|
|
css: {
|
|
...baseConfig.css,
|
|
preprocessorOptions: {
|
|
...baseConfig.css.preprocessorOptions,
|
|
scss: {
|
|
api: 'legacy',
|
|
importer: [
|
|
function (url) {
|
|
return url === 'virtual-dep' ? { contents: '' } : null
|
|
},
|
|
function (url) {
|
|
return url === 'virtual-file-absolute'
|
|
? {
|
|
contents: `@use "${pathToFileURL(path.join(import.meta.dirname, 'file-absolute.scss')).href}"`,
|
|
}
|
|
: null
|
|
},
|
|
function (url) {
|
|
return url.endsWith('.wxss') ? { contents: '' } : null
|
|
},
|
|
],
|
|
silenceDeprecations: ['legacy-js-api'],
|
|
},
|
|
},
|
|
},
|
|
})
|