vue3 webpack全局scss

module.exports = {
    chainWebpack: config => {
        const oneOfsMap = config.module.rule('scss').oneOfs.store
        oneOfsMap.forEach(item => {
            item
                .use('sass-resources-loader')
                .loader('sass-resources-loader')
                .options({
                    resources: ['./src/main.scss']//这里写要全局引入的scss文件
                })
                .end()
        })
    }
}

你可能感兴趣的:(vue,webpack,vscode,vue,vue-cli3)