mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-06 03:57:59 +08:00
feat(cli): generate document title
This commit is contained in:
parent
2782aedd92
commit
4588df560c
@ -22,6 +22,7 @@
|
||||
"author": "chenjiahan",
|
||||
"license": "MIT",
|
||||
"peerDependencies": {
|
||||
"vant": "^2.2.13",
|
||||
"vue": "^2.6.10",
|
||||
"vue-template-compiler": "^2.6.10"
|
||||
},
|
||||
@ -39,6 +40,7 @@
|
||||
"@types/webpack": "^4.39.8",
|
||||
"@types/webpack-dev-server": "^3.4.0",
|
||||
"@types/webpack-merge": "^4.1.5",
|
||||
"vant": "^2.2.13",
|
||||
"vue": "^2.6.10",
|
||||
"vue-template-compiler": "^2.6.10"
|
||||
},
|
||||
|
@ -2,6 +2,8 @@
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title><%= htmlWebpackPlugin.options.title %></title>
|
||||
<link rel="icon" type="image/png" href="<%= htmlWebpackPlugin.options.logo %>" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, viewport-fit=cover">
|
||||
<meta http-Equiv="Cache-Control" Content="no-cache" />
|
||||
<meta http-Equiv="Pragma" Content="no-cache" />
|
||||
|
@ -2,6 +2,8 @@
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title><%= htmlWebpackPlugin.options.title %></title>
|
||||
<link rel="icon" type="image/png" href="<%= htmlWebpackPlugin.options.logo %>" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, viewport-fit=cover">
|
||||
<meta http-Equiv="Cache-Control" Content="no-cache" />
|
||||
<meta http-Equiv="Pragma" Content="no-cache" />
|
||||
|
@ -1,9 +1,14 @@
|
||||
import { join } from 'path';
|
||||
import merge from 'webpack-merge';
|
||||
import config from './webpack.base';
|
||||
import baseConfig from './webpack.base';
|
||||
import HtmlWebpackPlugin from 'html-webpack-plugin';
|
||||
import { CONFIG_FILE } from '../common/constant';
|
||||
|
||||
module.exports = merge(config, {
|
||||
// eslint-disable-next-line
|
||||
const config = require(CONFIG_FILE);
|
||||
const title = `${config.title} - ${config.description}`;
|
||||
|
||||
module.exports = merge(baseConfig, {
|
||||
entry: {
|
||||
'site-desktop': join(__dirname, '../../site/desktop/main.js'),
|
||||
'site-mobile': join(__dirname, '../../site/mobile/main.js')
|
||||
@ -33,11 +38,15 @@ module.exports = merge(config, {
|
||||
},
|
||||
plugins: [
|
||||
new HtmlWebpackPlugin({
|
||||
title,
|
||||
logo: config.logo,
|
||||
chunks: ['chunks', 'site-desktop'],
|
||||
template: join(__dirname, '../../site/desktop/index.html'),
|
||||
filename: 'index.html'
|
||||
}),
|
||||
new HtmlWebpackPlugin({
|
||||
title,
|
||||
logo: config.logo,
|
||||
chunks: ['chunks', 'site-mobile'],
|
||||
template: join(__dirname, '../../site/mobile/index.html'),
|
||||
filename: 'mobile.html'
|
||||
|
@ -700,7 +700,7 @@
|
||||
core-js "^2.6.5"
|
||||
regenerator-runtime "^0.13.2"
|
||||
|
||||
"@babel/runtime@^7.6.3":
|
||||
"@babel/runtime@7.x", "@babel/runtime@^7.6.3":
|
||||
version "7.7.2"
|
||||
resolved "https://registry.npm.taobao.org/@babel/runtime/download/@babel/runtime-7.7.2.tgz?cache=0&sync_timestamp=1573083187206&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40babel%2Fruntime%2Fdownload%2F%40babel%2Fruntime-7.7.2.tgz#111a78002a5c25fc8e3361bedc9529c696b85a6a"
|
||||
integrity sha1-ERp4ACpcJfyOM2G+3JUpxpa4Wmo=
|
||||
@ -1441,6 +1441,11 @@
|
||||
eslint-plugin-import "^2.18.2"
|
||||
eslint-plugin-vue "^5.2.3"
|
||||
|
||||
"@vant/icons@1.1.15":
|
||||
version "1.1.15"
|
||||
resolved "https://registry.npm.taobao.org/@vant/icons/download/@vant/icons-1.1.15.tgz?cache=0&sync_timestamp=1571923117293&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40vant%2Ficons%2Fdownload%2F%40vant%2Ficons-1.1.15.tgz#53c51ace21e9992bfeeb2e1ad9094fbf6506d116"
|
||||
integrity sha1-U8UaziHpmSv+6y4a2QlPv2UG0RY=
|
||||
|
||||
"@vant/markdown-loader@^2.2.0":
|
||||
version "2.2.0"
|
||||
resolved "https://registry.npm.taobao.org/@vant/markdown-loader/download/@vant/markdown-loader-2.2.0.tgz#f685d7f9fb7582919230329c9263cf0c4798281b"
|
||||
@ -10753,6 +10758,16 @@ validate-npm-package-license@^3.0.1:
|
||||
spdx-correct "^3.0.0"
|
||||
spdx-expression-parse "^3.0.0"
|
||||
|
||||
vant@^2.2.13:
|
||||
version "2.2.13"
|
||||
resolved "https://registry.npm.taobao.org/vant/download/vant-2.2.13.tgz#394b6c75c919d2924bd025ae1cc797aac0ee76dd"
|
||||
integrity sha1-OUtsdckZ0pJL0CWuHMeXqsDudt0=
|
||||
dependencies:
|
||||
"@babel/runtime" "7.x"
|
||||
"@vant/icons" "1.1.15"
|
||||
"@vue/babel-helper-vue-jsx-merge-props" "^1.0.0"
|
||||
vue-lazyload "1.2.3"
|
||||
|
||||
vary@~1.1.2:
|
||||
version "1.1.2"
|
||||
resolved "https://registry.npm.taobao.org/vary/download/vary-1.1.2.tgz#2299f02c6ded30d4a5961b0b9f74524a18f634fc"
|
||||
@ -10831,6 +10846,11 @@ vue-jest@4.0.0-beta.2:
|
||||
source-map "^0.5.6"
|
||||
ts-jest "^23.10.5"
|
||||
|
||||
vue-lazyload@1.2.3:
|
||||
version "1.2.3"
|
||||
resolved "https://registry.npm.taobao.org/vue-lazyload/download/vue-lazyload-1.2.3.tgz#901f9ec15c7e6ca78781a2bae4a343686bdedb2c"
|
||||
integrity sha1-kB+ewVx+bKeHgaK65KNDaGve2yw=
|
||||
|
||||
vue-loader@^15.7.2:
|
||||
version "15.7.2"
|
||||
resolved "https://registry.npm.taobao.org/vue-loader/download/vue-loader-15.7.2.tgz#cc89e2716df87f70fe656c9da9d7f8bec06c73d6"
|
||||
|
Loading…
x
Reference in New Issue
Block a user