mirror of
https://github.com/youzan/vant.git
synced 2025-10-20 18:54:24 +00:00
feat(cli): generate document title
This commit is contained in:
@@ -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'
|
||||
|
Reference in New Issue
Block a user