after the vue project is packaged, there is no icon for the title on the browser?
webpack.prod.config.js:
const webpack = require("webpack");
const HtmlWebpackPlugin = require("html-webpack-plugin");
const ExtractTextPlugin = require("extract-text-webpack-plugin");
const CopyWebpackPlugin = require("copy-webpack-plugin");
const cleanWebpackPlugin = require("clean-webpack-plugin");
const UglifyJsParallelPlugin = require("webpack-uglify-parallel");
const merge = require("webpack-merge");
const webpackBaseConfig = require("./webpack.base.config.js");
const os = require("os");
const fs = require("fs");
const path = require("path");
const package = require("../package.json");
fs.open("./build/env.js", "w", function(err, fd) {
const buf = "export default "production";";
fs.write(fd, buf, 0, buf.length, 0, function(err, written, buffer) {});
});
module.exports = merge(webpackBaseConfig, {
output: {
publicPath: "./dist/",
filename: "[name].[hash].js",
chunkFilename: "[name].[hash].chunk.js"
},
plugins: [
new cleanWebpackPlugin(["dist/*"], {
root: path.resolve(__dirname, "../")
}),
new ExtractTextPlugin({
filename: "[name].[hash].css",
allChunks: true
}),
new webpack.optimize.CommonsChunkPlugin({
// name: "vendors",
// filename: "vendors.[hash].js"
name: ["vender-exten", "vender-base"],
minChunks: Infinity
}),
new webpack.DefinePlugin({
"process.env": {
NODE_ENV: ""production""
}
}),
new webpack.optimize.UglifyJsPlugin({
compress: {
warnings: false
}
}),
// new UglifyJsParallelPlugin({
// workers: os.cpus().length,
// mangle: true,
// compressor: {
// warnings: false,
// drop_console: true,
// drop_debugger: true
// }
// }),
new CopyWebpackPlugin([
{
from: "td_icon.ico"
},
{
from: "src/styles/fonts",
to: "fonts"
},
{
from: "src/views/main-components/theme-switch/theme"
},
{
from: "src/views/my-components/text-editor/tinymce"
}
], {
ignore: [
"text-editor.vue"
]
}),
new HtmlWebpackPlugin({
title: "admin v" + package.version,
favicon: "./td_icon.ico",
filename: "../index.html",
template: "!!ejs-loader!./src/template/index.ejs",
inject: false
})
]
});
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<title>admin</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=0">
<link rel="stylesheet" href="./dist/main.css">
<link rel="stylesheet" name="theme" href="">
<link rel="icon" href="./td_icon.ico" type="image/x-icon" />
</head>
<body>
<div id="app"></div>
<script type="text/javascript" src="./dist/vender-base.js"></script>
<script type="text/javascript" src="./dist/vender-exten.js"></script>
<script type="text/javascript" src="./dist/main.js"></script>
</body>
</html>
the above two files are the configuration before packaging
the problem is this:
: