提交 55a6197c 编写于 作者: fxy060608's avatar fxy060608

feat(cli): Compatible with sass-loader@9 #1861

上级 44e31c52
......@@ -25,7 +25,7 @@ const postcssLoader = {
options: {
sourceMap: false,
parser: require('postcss-comment'),
plugins: [
plugins: [
require('postcss-import')({
resolve (id, basedir, importOptions) {
if (id.startsWith('~@/')) {
......@@ -77,12 +77,13 @@ if (sassLoaderVersion < 8) {
sassLoader.options.outputStyle = 'expanded'
sassLoader.options.indentedSyntax = true
} else {
scssLoader.options.prependData = sassData
const name = sassLoaderVersion >= 9 ? 'additionalData' : 'prependData'
scssLoader.options[name] = sassData
scssLoader.options.sassOptions = {
outputStyle: 'expanded'
}
sassLoader.options.prependData = sassData
sassLoader.options[name] = sassData
sassLoader.options.sassOptions = {
outputStyle: 'expanded',
indentedSyntax: true
......
......@@ -85,8 +85,9 @@ module.exports = function initOptions (options) {
if (sassLoaderVersion < 8) {
options.css.loaderOptions.sass.data = sassData
} else {
options.css.loaderOptions.sass.prependData = sassData
} else {
const name = sassLoaderVersion >= 9 ? 'additionalData' : 'prependData'
options.css.loaderOptions.sass[name] = sassData
}
const userPostcssConfigPath = path.resolve(process.env.UNI_INPUT_DIR, 'postcss.config.js')
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册