Unverified Commit e9e038d3 authored by Janne Kurkinen's avatar Janne Kurkinen Committed by GitHub

docs: 'prependData' option renamed to 'additionalData' in sass-loader 9 (#1714) [skip ci]

parent d5f7e165
...@@ -75,7 +75,7 @@ Note that `sass-loader` processes the non-indent-based `scss` syntax by default. ...@@ -75,7 +75,7 @@ Note that `sass-loader` processes the non-indent-based `scss` syntax by default.
### Sharing Global Variables ### Sharing Global Variables
`sass-loader` also supports a `prependData` option which allows you to share common variables among all processed files without having to explicit import them: `sass-loader` also supports a `additionalData` option which allows you to share common variables among all processed files without having to explicit import them:
``` js ``` js
// webpack.config.js -> module.rules // webpack.config.js -> module.rules
...@@ -88,8 +88,9 @@ Note that `sass-loader` processes the non-indent-based `scss` syntax by default. ...@@ -88,8 +88,9 @@ Note that `sass-loader` processes the non-indent-based `scss` syntax by default.
loader: 'sass-loader', loader: 'sass-loader',
options: { options: {
// you can also read from a file, e.g. `variables.scss` // you can also read from a file, e.g. `variables.scss`
// use `data` here if sass-loader version < 8 // use `prependData` here if sass-loader version = 8, or
prependData: `$color: red;` // `data` if sass-loader version < 8
additionalData: `$color: red;`
} }
} }
] ]
......
...@@ -88,8 +88,9 @@ module.exports = { ...@@ -88,8 +88,9 @@ module.exports = {
loader: 'sass-loader', loader: 'sass-loader',
options: { options: {
// вы можете также указать файл, например `variables.scss` // вы можете также указать файл, например `variables.scss`
// используйте свойство `prependData` здесь, если версия sass-loader = 8
// используйте свойство `data` здесь, если версия sass-loader < 8 // используйте свойство `data` здесь, если версия sass-loader < 8
prependData: `$color: red;` additionalData: `$color: red;`
} }
} }
] ]
......
...@@ -88,8 +88,9 @@ module.exports = { ...@@ -88,8 +88,9 @@ module.exports = {
loader: 'sass-loader', loader: 'sass-loader',
options: { options: {
// 你也可以从一个文件读取,例如 `variables.scss` // 你也可以从一个文件读取,例如 `variables.scss`
// 如果 sass-loader 版本 = 8,这里使用 `prependData` 字段
// 如果 sass-loader 版本 < 8,这里使用 `data` 字段 // 如果 sass-loader 版本 < 8,这里使用 `data` 字段
prependData: `$color: red;` additionalData: `$color: red;`
} }
} }
] ]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment