mirror of
https://github.com/vuejs/vue-cli.git
synced 2026-01-16 04:10:20 -06:00
chore: Merge branch 'master' into dev
This commit is contained in:
@@ -15,7 +15,7 @@ file, or the `"vue"` field in `package.json`.
|
||||
|
||||
- **pwa.workboxPluginMode**
|
||||
|
||||
This allows you to the choose between the two modes supported by the underlying
|
||||
This allows you to choose between the two modes supported by the underlying
|
||||
[`workbox-webpack-plugin`](https://developers.google.com/web/tools/workbox/modules/workbox-webpack-plugin).
|
||||
|
||||
- `'GenerateSW'` (default), will lead to a new service worker file being created
|
||||
@@ -83,6 +83,30 @@ file, or the `"vue"` field in `package.json`.
|
||||
- start_url: `'.'`
|
||||
- display: `'standalone'`
|
||||
- theme_color: `pwa.themeColor`
|
||||
- icons: `[
|
||||
{
|
||||
'src': './img/icons/android-chrome-192x192.png',
|
||||
'sizes': '192x192',
|
||||
'type': 'image/png'
|
||||
},
|
||||
{
|
||||
'src': './img/icons/android-chrome-512x512.png',
|
||||
'sizes': '512x512',
|
||||
'type': 'image/png'
|
||||
},
|
||||
{
|
||||
'src': './img/icons/android-chrome-maskable-192x192.png',
|
||||
'sizes': '192x192',
|
||||
'type': 'image/png',
|
||||
'purpose': 'maskable'
|
||||
},
|
||||
{
|
||||
'src': './img/icons/android-chrome-maskable-512x512.png',
|
||||
'sizes': '512x512',
|
||||
'type': 'image/png',
|
||||
'purpose': 'maskable'
|
||||
}
|
||||
]`
|
||||
|
||||
- **pwa.manifestCrossorigin**
|
||||
|
||||
@@ -106,6 +130,8 @@ file, or the `"vue"` field in `package.json`.
|
||||
|
||||
Change these values to use different paths for your icons. As of v4.3.0, you can use `null` as a value and that icon will not be included.
|
||||
|
||||
*NOTE:* These icons are only used to generate the meta tags in the `<head>` of your HTML doc. To change the icon paths for your manifest please use `pwa.manifestOptions.icons`
|
||||
|
||||
### Example Configuration
|
||||
|
||||
```js
|
||||
|
||||
@@ -133,17 +133,17 @@ module.exports = {
|
||||
// pass options to sass-loader
|
||||
// @/ is an alias to src/
|
||||
// so this assumes you have a file named `src/variables.sass`
|
||||
// Note: this option is named as "data" in sass-loader v7
|
||||
// Note: this option is named as "prependData" in sass-loader v8
|
||||
sass: {
|
||||
prependData: `@import "~@/variables.sass"`
|
||||
additionalData: `@import "~@/variables.sass"`
|
||||
},
|
||||
// by default the `sass` option will apply to both syntaxes
|
||||
// because `scss` syntax is also processed by sass-loader underlyingly
|
||||
// but when configuring the `data` option
|
||||
// but when configuring the `prependData` option
|
||||
// `scss` syntax requires an semicolon at the end of a statement, while `sass` syntax requires none
|
||||
// in that case, we can target the `scss` syntax separately using the `scss` option
|
||||
scss: {
|
||||
prependData: `@import "~@/variables.scss";`
|
||||
additionalData: `@import "~@/variables.scss";`
|
||||
},
|
||||
// pass Less.js Options to less-loader
|
||||
less:{
|
||||
|
||||
@@ -261,7 +261,7 @@ firebase deploy --only hosting
|
||||
|
||||
If you want other Firebase CLI features you use on your project to be deployed, run `firebase deploy` without the `--only` option.
|
||||
|
||||
You can now access your project on `https://<YOUR-PROJECT-ID>.firebaseapp.com`.
|
||||
You can now access your project on `https://<YOUR-PROJECT-ID>.firebaseapp.com` or `https://<YOUR-PROJECT-ID>.web.app`.
|
||||
|
||||
Please refer to the [Firebase Documentation](https://firebase.google.com/docs/hosting/deploying) for more details.
|
||||
|
||||
|
||||
@@ -135,17 +135,17 @@ module.exports = {
|
||||
// передача настроек в sass-loader
|
||||
// @/ это псевдоним к каталогу src/ поэтому предполагается,
|
||||
// что у вас в проекте есть файл `src/variables.scss`
|
||||
// Примечание: эта опция называется "data" в sass-loader v7
|
||||
// Примечание: эта опция называется "prependData" в sass-loader v8
|
||||
sass: {
|
||||
prependData: `@import "~@/variables.sass"`
|
||||
additionalData: `@import "~@/variables.sass"`
|
||||
},
|
||||
// по умолчанию опция `sass` будет применяться к обоим синтаксисам
|
||||
// потому что синтаксис `scss` по сути также обрабатывается sass-loader
|
||||
// но при настройке опции `data` синтаксис `scss` требует точку с запятой
|
||||
// но при настройке опции `prependData` синтаксис `scss` требует точку с запятой
|
||||
// в конце оператора, в то время как для `sass` точки с запятой не требуется
|
||||
// в этом случае синтаксис `scss` можно настроить отдельно с помощью опции `scss`
|
||||
scss: {
|
||||
prependData: `@import "~@/variables.scss";`
|
||||
additionalData: `@import "~@/variables.scss";`
|
||||
},
|
||||
// передача настроек Less.js в less-loader
|
||||
less:{
|
||||
|
||||
@@ -288,7 +288,7 @@ module.exports.hooks = (api) => {
|
||||
const renderIndex = lines.findIndex(line => line.match(/render/))
|
||||
lines[renderIndex] += `${EOL} router,`
|
||||
|
||||
fs.writeFileSync(api.entryFile, line.join(EOL), { encoding: 'utf-8' })
|
||||
fs.writeFileSync(api.entryFile, lines.join(EOL), { encoding: 'utf-8' })
|
||||
})
|
||||
}
|
||||
```
|
||||
@@ -301,7 +301,7 @@ Service 插件在 Service 实例被创建后自动加载 - 例如,每次 `vue-
|
||||
|
||||
一个 service 插件应该导出一个函数,这个函数接受两个参数:
|
||||
|
||||
- 一个 [PluginAPI][plugin-api] 实例
|
||||
- 一个 [PluginAPI][plugin-api.md] 实例
|
||||
|
||||
- 一个包含 `vue.config.js` 内指定的项目本地选项的对象,或者在 `package.json` 内的 `vue` 字段。
|
||||
|
||||
|
||||
@@ -126,16 +126,16 @@ module.exports = {
|
||||
sass: {
|
||||
// @/ 是 src/ 的别名
|
||||
// 所以这里假设你有 `src/variables.sass` 这个文件
|
||||
// 注意:在 sass-loader v7 中,这个选项名是 "data"
|
||||
prependData: `@import "~@/variables.sass"`
|
||||
// 注意:在 sass-loader v8 中,这个选项名是 "prependData"
|
||||
additionalData: `@import "~@/variables.sass"`
|
||||
},
|
||||
// 默认情况下 `sass` 选项会同时对 `sass` 和 `scss` 语法同时生效
|
||||
// 因为 `scss` 语法在内部也是由 sass-loader 处理的
|
||||
// 但是在配置 `data` 选项的时候
|
||||
// 但是在配置 `prependData` 选项的时候
|
||||
// `scss` 语法会要求语句结尾必须有分号,`sass` 则要求必须没有分号
|
||||
// 在这种情况下,我们可以使用 `scss` 选项,对 `scss` 语法进行单独配置
|
||||
scss: {
|
||||
prependData: `@import "~@/variables.scss";`
|
||||
additionalData: `@import "~@/variables.scss";`
|
||||
},
|
||||
// 给 less-loader 传递 Less.js 相关选项
|
||||
less:{
|
||||
|
||||
@@ -15,7 +15,7 @@ file, or the `"vue"` field in `package.json`.
|
||||
|
||||
- **pwa.workboxPluginMode**
|
||||
|
||||
This allows you to the choose between the two modes supported by the underlying
|
||||
This allows you to choose between the two modes supported by the underlying
|
||||
[`workbox-webpack-plugin`](https://developers.google.com/web/tools/workbox/modules/workbox-webpack-plugin).
|
||||
|
||||
- `'GenerateSW'` (default), will lead to a new service worker file being created
|
||||
|
||||
Reference in New Issue
Block a user