Skip to content

Commit

Permalink
add webpack favicon
Browse files Browse the repository at this point in the history
  • Loading branch information
Elegenthus committed May 25, 2017
1 parent 094998c commit d92671a
Show file tree
Hide file tree
Showing 9 changed files with 10 additions and 4 deletions.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,11 @@
"eslint": "^2.13.1",
"eslint-config-airbnb": "^9.0.1",
"extract-text-webpack-plugin": "^1.0.1",
"favicons-webpack-plugin": "0.0.7",
"file-loader": "^0.9.0",
"html-loader": "^0.4.4",
"html-webpack-harddisk-plugin": "0.0.2",
"html-webpack-plugin": "^2.24.1",
"html-webpack-plugin": "^2.28.0",
"node-sass": "^3.10.1",
"postcss-loader": "^0.13.0",
"sass-loader": "^4.0.2",
Expand Down
Binary file added src/img/1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/img/2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed src/img/favicon-32x32.png
Binary file not shown.
Binary file added src/img/favicon.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 0 additions & 1 deletion template/base.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
<meta name="Copyright" content = "华中师范大学木犀团队Hello from Wuhan,2014-2017 Muxistudio">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no" />
<link rel="icon" type="image/png" href="http://img05.tooopen.com/images/20150128/sy_79896567561.jpg" sizes="32x32" />
<title>华大桂声</title>
</head>

Expand Down
3 changes: 1 addition & 2 deletions template/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,8 @@
<meta name="Copyright" content = "华中师范大学木犀团队Hello from Wuhan,2014-2017 Muxistudio">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no" />
<link rel="icon" type="image/png" href="http://img05.tooopen.com/images/20150128/sy_79896567561.jpg" sizes="32x32" />
<title>华大桂声</title>
</head>
<link rel="apple-touch-icon" sizes="57x57" href="http://localhost:3000/dist/icons-33dc78f3822b6f345d7923a83f3f6d16/apple-touch-icon-57x57.png"><link rel="apple-touch-icon" sizes="60x60" href="http://localhost:3000/dist/icons-33dc78f3822b6f345d7923a83f3f6d16/apple-touch-icon-60x60.png"><link rel="apple-touch-icon" sizes="72x72" href="http://localhost:3000/dist/icons-33dc78f3822b6f345d7923a83f3f6d16/apple-touch-icon-72x72.png"><link rel="apple-touch-icon" sizes="76x76" href="http://localhost:3000/dist/icons-33dc78f3822b6f345d7923a83f3f6d16/apple-touch-icon-76x76.png"><link rel="apple-touch-icon" sizes="114x114" href="http://localhost:3000/dist/icons-33dc78f3822b6f345d7923a83f3f6d16/apple-touch-icon-114x114.png"><link rel="apple-touch-icon" sizes="120x120" href="http://localhost:3000/dist/icons-33dc78f3822b6f345d7923a83f3f6d16/apple-touch-icon-120x120.png"><link rel="apple-touch-icon" sizes="144x144" href="http://localhost:3000/dist/icons-33dc78f3822b6f345d7923a83f3f6d16/apple-touch-icon-144x144.png"><link rel="apple-touch-icon" sizes="152x152" href="http://localhost:3000/dist/icons-33dc78f3822b6f345d7923a83f3f6d16/apple-touch-icon-152x152.png"><link rel="apple-touch-icon" sizes="180x180" href="http://localhost:3000/dist/icons-33dc78f3822b6f345d7923a83f3f6d16/apple-touch-icon-180x180.png"><meta name="apple-mobile-web-app-capable" content="yes"><meta name="apple-mobile-web-app-status-bar-style" content="black-translucent"><meta name="apple-mobile-web-app-title" content="guisheng_fe"><meta name="mobile-web-app-capable" content="yes"><meta name="theme-color" content="#fff"><meta name="application-name" content="guisheng_fe"><link rel="icon" type="image/png" sizes="32x32" href="http://localhost:3000/dist/icons-33dc78f3822b6f345d7923a83f3f6d16/favicon-32x32.png"><link rel="icon" type="image/png" sizes="16x16" href="http://localhost:3000/dist/icons-33dc78f3822b6f345d7923a83f3f6d16/favicon-16x16.png"><link rel="shortcut icon" href="http://localhost:3000/dist/icons-33dc78f3822b6f345d7923a83f3f6d16/favicon.ico"><link rel="apple-touch-startup-image" media="(device-width: 320px) and (device-height: 480px) and (-webkit-device-pixel-ratio: 1)" href="http://localhost:3000/dist/icons-33dc78f3822b6f345d7923a83f3f6d16/apple-touch-startup-image-320x460.png"><link rel="apple-touch-startup-image" media="(device-width: 320px) and (device-height: 480px) and (-webkit-device-pixel-ratio: 2)" href="http://localhost:3000/dist/icons-33dc78f3822b6f345d7923a83f3f6d16/apple-touch-startup-image-640x920.png"><link rel="apple-touch-startup-image" media="(device-width: 320px) and (device-height: 568px) and (-webkit-device-pixel-ratio: 2)" href="http://localhost:3000/dist/icons-33dc78f3822b6f345d7923a83f3f6d16/apple-touch-startup-image-640x1096.png"><link rel="apple-touch-startup-image" media="(device-width: 375px) and (device-height: 667px) and (-webkit-device-pixel-ratio: 2)" href="http://localhost:3000/dist/icons-33dc78f3822b6f345d7923a83f3f6d16/apple-touch-startup-image-750x1294.png"><link rel="apple-touch-startup-image" media="(device-width: 414px) and (device-height: 736px) and (orientation: landscape) and (-webkit-device-pixel-ratio: 3)" href="http://localhost:3000/dist/icons-33dc78f3822b6f345d7923a83f3f6d16/apple-touch-startup-image-1182x2208.png"><link rel="apple-touch-startup-image" media="(device-width: 414px) and (device-height: 736px) and (orientation: portrait) and (-webkit-device-pixel-ratio: 3)" href="http://localhost:3000/dist/icons-33dc78f3822b6f345d7923a83f3f6d16/apple-touch-startup-image-1242x2148.png"><link rel="apple-touch-startup-image" media="(device-width: 768px) and (device-height: 1024px) and (orientation: landscape) and (-webkit-device-pixel-ratio: 1)" href="http://localhost:3000/dist/icons-33dc78f3822b6f345d7923a83f3f6d16/apple-touch-startup-image-748x1024.png"><link rel="apple-touch-startup-image" media="(device-width: 768px) and (device-height: 1024px) and (orientation: portrait) and (-webkit-device-pixel-ratio: 1)" href="http://localhost:3000/dist/icons-33dc78f3822b6f345d7923a83f3f6d16/apple-touch-startup-image-768x1004.png"><link rel="apple-touch-startup-image" media="(device-width: 768px) and (device-height: 1024px) and (orientation: landscape) and (-webkit-device-pixel-ratio: 2)" href="http://localhost:3000/dist/icons-33dc78f3822b6f345d7923a83f3f6d16/apple-touch-startup-image-1496x2048.png"><link rel="apple-touch-startup-image" media="(device-width: 768px) and (device-height: 1024px) and (orientation: portrait) and (-webkit-device-pixel-ratio: 2)" href="http://localhost:3000/dist/icons-33dc78f3822b6f345d7923a83f3f6d16/apple-touch-startup-image-1536x2008.png"></head>

<body>
{% block msg %}{% endblock %}
Expand Down
4 changes: 4 additions & 0 deletions webpack.build.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ const ExtractTextPlugin = require('extract-text-webpack-plugin');
const autoprefixer = require('autoprefixer');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const HtmlWebpackHarddiskPlugin = require('html-webpack-harddisk-plugin');
let FaviconsWebpackPlugin = require('favicons-webpack-plugin');

module.exports = {
entry: {
Expand Down Expand Up @@ -70,6 +71,7 @@ module.exports = {
filename: 'template/base.html',
inject: false,
template: './template/base.ejs',
favicon: './src/img/1.png',
chunks: ['vendor']
}),
new HtmlWebpackPlugin({
Expand Down Expand Up @@ -122,6 +124,7 @@ module.exports = {
chunks: ['profile']
}),
new HtmlWebpackHarddiskPlugin(),
new FaviconsWebpackPlugin('./src/img/1.png'),
new webpack.optimize.OccurenceOrderPlugin(),
new webpack.NoErrorsPlugin(),
new webpack.optimize.UglifyJsPlugin({
Expand All @@ -130,6 +133,7 @@ module.exports = {
warnings: false,
},
}),
// new FaviconsWebpackPlugin('src/img/1.png'),
new webpack.optimize.CommonsChunkPlugin("vendor", "vendor.[hash].js")
]
};
3 changes: 3 additions & 0 deletions webpack.dev.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ const ExtractTextPlugin = require('extract-text-webpack-plugin');
const autoprefixer = require('autoprefixer');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const HtmlWebpackHarddiskPlugin = require('html-webpack-harddisk-plugin');
let FaviconsWebpackPlugin = require('favicons-webpack-plugin');

module.exports = {
entry: {
Expand Down Expand Up @@ -67,6 +68,7 @@ module.exports = {
filename: 'template/base.html',
inject: false,
template: './template/base.ejs',
// favicon: './src/img/1.png',
chunks: ['vendor']
}),
new HtmlWebpackPlugin({
Expand Down Expand Up @@ -119,6 +121,7 @@ module.exports = {
chunks: ['search.js']
}),
new HtmlWebpackHarddiskPlugin(),
new FaviconsWebpackPlugin('./src/img/1.png'),
new webpack.optimize.OccurenceOrderPlugin(),
new webpack.HotModuleReplacementPlugin(),
new webpack.NoErrorsPlugin(),
Expand Down

0 comments on commit d92671a

Please sign in to comment.