webpack分块打包优化性能
This commit is contained in:
parent
0724a66403
commit
4117c3b7ff
@ -79,6 +79,7 @@
|
||||
font-family: Menlo,Monaco,"Andale Mono","lucida console","Courier New","Microsoft YaHei";
|
||||
word-wrap: break-word;
|
||||
font-size: 14px;
|
||||
border-radius: $radiusSmall;
|
||||
}
|
||||
blockquote {
|
||||
padding: 15px 20px;
|
||||
|
||||
@ -694,10 +694,6 @@
|
||||
-ms-transition: all 0.8s ease-in;
|
||||
}
|
||||
|
||||
%line-bg {
|
||||
background: linear-gradient(200deg, #a0cfe4, #e8c37e);
|
||||
}
|
||||
|
||||
%paper-bg {
|
||||
background: url('./img/checkered-pattern.png') repeat #5d5d5d;
|
||||
}
|
||||
|
||||
@ -41,12 +41,6 @@ $colorA: #aaa;
|
||||
$colorC: #ccc;
|
||||
$colorF: #f5f5f5;
|
||||
|
||||
$blue: #007aff !default;
|
||||
$orange: #ff9500 !default;
|
||||
$red: #ff3b30 !default;
|
||||
$green: #4cd964 !default;
|
||||
$primary: #007aff !default;
|
||||
|
||||
|
||||
// 元素上下间距
|
||||
//-----------------------------------------------------
|
||||
@ -74,11 +68,4 @@ $timingFunction: cubic-bezier(0.42, 0, 0.58, 1);
|
||||
$activeStateSwitch: true !default;
|
||||
|
||||
|
||||
// z-index
|
||||
//-----------------------------------------------------
|
||||
$zIndexHeader: 1000 !default;
|
||||
$zIndexFooter: 2000 !default;
|
||||
$zIndexPopup: 3000 !default;
|
||||
$zIndexOverlay: 4000 !default; // 默认高于header和footer部分
|
||||
|
||||
$articlePadding: 7.6923%;
|
||||
@ -257,9 +257,6 @@ html, body, #container {
|
||||
.archives-wrap{
|
||||
margin: 10px 10px 0px;
|
||||
padding: 10px;
|
||||
.archive-article-title{
|
||||
font-size: 16px;
|
||||
}
|
||||
.archive-year-wrap{
|
||||
position: relative;
|
||||
padding: 0 0 0 0;
|
||||
|
||||
@ -1,54 +1,66 @@
|
||||
/*
|
||||
* 夜间模式配色
|
||||
*/
|
||||
$mainBg_night: #1f2e3c; // 主背景色
|
||||
$articleBg_night: #15202b; // 文章背景色
|
||||
$textColor_night: #d5d5d5; // 文字颜色
|
||||
|
||||
body.night {
|
||||
background: $mainBg_night;
|
||||
// 展开菜单之后的背景
|
||||
#container.show {
|
||||
background: none;
|
||||
}
|
||||
// 主背景
|
||||
.mid-col {
|
||||
background: $mainBg_night;
|
||||
}
|
||||
// 文章区域
|
||||
.article{
|
||||
background: $articleBg_night;
|
||||
border-color: rgb(56, 68, 77);
|
||||
color: $textColor_night;
|
||||
.article-title { // 主标题
|
||||
color: $colorF;
|
||||
}
|
||||
.article-entry blockquote{ // 引用
|
||||
background: #2c2c2c;
|
||||
}
|
||||
h1,h2,h3,h4,h5,h6 { // 章节标题
|
||||
color: #b8a7a7;
|
||||
}
|
||||
}
|
||||
// 左侧栏
|
||||
.left-col {
|
||||
background: $articleBg_night;
|
||||
.overlay {
|
||||
background: none;
|
||||
}
|
||||
.profilepic { // 头像
|
||||
filter: brightness(30%);
|
||||
}
|
||||
}
|
||||
// 看板娘
|
||||
.waifu {
|
||||
filter: brightness(30%);
|
||||
}
|
||||
// 评论
|
||||
#comments {
|
||||
background: none;
|
||||
}
|
||||
#footer {
|
||||
color: $textColor_night;
|
||||
}
|
||||
/*
|
||||
* 夜间模式配色
|
||||
*/
|
||||
$mainBg_night: #1f2e3c; // 主背景色
|
||||
$articleBg_night: #15202b; // 文章背景色
|
||||
$borderColor_night: #38444d; // 边框颜色
|
||||
$textColor_night: #d5d5d5; // 文字颜色
|
||||
|
||||
body.night {
|
||||
background: $mainBg_night;
|
||||
// 展开菜单之后的背景
|
||||
#container.show {
|
||||
background: none;
|
||||
}
|
||||
// 主背景
|
||||
.mid-col {
|
||||
background: $mainBg_night;
|
||||
}
|
||||
// 文章区域
|
||||
.article{
|
||||
background: $articleBg_night;
|
||||
border-color: $borderColor_night;
|
||||
color: $textColor_night;
|
||||
.article-title { // 主标题
|
||||
color: $colorF;
|
||||
}
|
||||
.article-entry blockquote{ // 引用
|
||||
background: #2c2c2c;
|
||||
}
|
||||
h1,h2,h3,h4,h5,h6 { // 章节标题
|
||||
color: #b8a7a7;
|
||||
}
|
||||
}
|
||||
// 归档列表
|
||||
.archives-wrap {
|
||||
background: $articleBg_night;
|
||||
border-bottom-color: $borderColor_night;
|
||||
.archive-article {
|
||||
border-color: $borderColor_night;
|
||||
}
|
||||
a.archive-article-title {
|
||||
color: $textColor_night;
|
||||
}
|
||||
}
|
||||
// 左侧栏
|
||||
.left-col {
|
||||
background: $articleBg_night;
|
||||
.overlay {
|
||||
background: none;
|
||||
}
|
||||
.profilepic { // 头像
|
||||
filter: brightness(30%);
|
||||
}
|
||||
}
|
||||
// 看板娘
|
||||
.waifu {
|
||||
filter: brightness(30%);
|
||||
}
|
||||
// 评论
|
||||
#comments {
|
||||
background: none;
|
||||
}
|
||||
#footer {
|
||||
color: $textColor_night;
|
||||
}
|
||||
}
|
||||
@ -55,7 +55,7 @@
|
||||
}
|
||||
}
|
||||
.waifu-tool {
|
||||
color: #aaa;
|
||||
color: $colorA;
|
||||
top: 100px;
|
||||
right: 10px;
|
||||
font-size: 14px;
|
||||
@ -90,17 +90,6 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
/*
|
||||
body.night .waifu {
|
||||
color: #34495e;
|
||||
filter: brightness(30%);
|
||||
}
|
||||
*/
|
||||
@media (max-width: 768px) {
|
||||
.waifu {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes shake {
|
||||
2% {
|
||||
|
||||
@ -1,16 +1,16 @@
|
||||
// const AV = require('leancloud-storage');
|
||||
window.AV = require('leancloud-storage');
|
||||
const Valine = require('../lib/Valine.min');
|
||||
// const Valine = require('../lib/Valine.min');
|
||||
/**
|
||||
* Valine.min.js.bak文件, 是根据Valine项目源代码重新打包的
|
||||
* 使用根据Valine项目源代码重新打包
|
||||
* 可以支持对于AV对象的传参输入, 而不需要暴露全局变量
|
||||
* 但是缺少一些新功能
|
||||
*/
|
||||
// 评论配置
|
||||
const commentConfig = require("../config/comment.json");
|
||||
const commentConfig = require("../config/comment.json")
|
||||
|
||||
if(window.yiliaConfig.isPost && commentConfig.valine.enable) {
|
||||
commentConfig.valine.config.path = window.location.pathname;
|
||||
// commentConfig.valine.config.av = AV;
|
||||
new Valine(commentConfig.valine.config);
|
||||
}
|
||||
import(/* webpackChunkName: "valine" */ '../lib/Valine.min').then(({ default: Valine }) => {
|
||||
commentConfig.valine.config.path = window.location.pathname
|
||||
// commentConfig.valine.config.av = AV;
|
||||
new Valine(commentConfig.valine.config)
|
||||
})
|
||||
|
||||
@ -14,3 +14,8 @@ Util.addLoadEvent(function() {
|
||||
// Viewer.init()
|
||||
Aside.init()
|
||||
})
|
||||
const commentConfig = require("../config/comment.json")
|
||||
if(window.yiliaConfig.isPost && commentConfig.valine.enable) {
|
||||
// 如果是文章详情页面, 并且启用了评论, 则加载评论相关代码
|
||||
import(/* webpackChunkName: "comment" */ './comment')
|
||||
}
|
||||
File diff suppressed because one or more lines are too long
@ -15,11 +15,12 @@ module.exports = {
|
||||
main: "./source-src/js/main.js",
|
||||
slider: "./source-src/js/slider.js",
|
||||
mobile: ["babel-polyfill", "./source-src/js/mobile.js"],
|
||||
comment: "./source-src/js/comment.js",
|
||||
// comment: "./source-src/js/comment.js",
|
||||
viewer: "./source-src/js/viewer.js",
|
||||
waifu: "./source-src/js/waifu.js"
|
||||
},
|
||||
output: {
|
||||
publicPath: '/',
|
||||
path: __dirname+"/source",
|
||||
filename: "js/[name].[chunkhash:8].js"
|
||||
},
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user