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";
|
font-family: Menlo,Monaco,"Andale Mono","lucida console","Courier New","Microsoft YaHei";
|
||||||
word-wrap: break-word;
|
word-wrap: break-word;
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
|
border-radius: $radiusSmall;
|
||||||
}
|
}
|
||||||
blockquote {
|
blockquote {
|
||||||
padding: 15px 20px;
|
padding: 15px 20px;
|
||||||
|
|||||||
@ -694,10 +694,6 @@
|
|||||||
-ms-transition: all 0.8s ease-in;
|
-ms-transition: all 0.8s ease-in;
|
||||||
}
|
}
|
||||||
|
|
||||||
%line-bg {
|
|
||||||
background: linear-gradient(200deg, #a0cfe4, #e8c37e);
|
|
||||||
}
|
|
||||||
|
|
||||||
%paper-bg {
|
%paper-bg {
|
||||||
background: url('./img/checkered-pattern.png') repeat #5d5d5d;
|
background: url('./img/checkered-pattern.png') repeat #5d5d5d;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -41,12 +41,6 @@ $colorA: #aaa;
|
|||||||
$colorC: #ccc;
|
$colorC: #ccc;
|
||||||
$colorF: #f5f5f5;
|
$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;
|
$activeStateSwitch: true !default;
|
||||||
|
|
||||||
|
|
||||||
// z-index
|
|
||||||
//-----------------------------------------------------
|
|
||||||
$zIndexHeader: 1000 !default;
|
|
||||||
$zIndexFooter: 2000 !default;
|
|
||||||
$zIndexPopup: 3000 !default;
|
|
||||||
$zIndexOverlay: 4000 !default; // 默认高于header和footer部分
|
|
||||||
|
|
||||||
$articlePadding: 7.6923%;
|
$articlePadding: 7.6923%;
|
||||||
@ -257,9 +257,6 @@ html, body, #container {
|
|||||||
.archives-wrap{
|
.archives-wrap{
|
||||||
margin: 10px 10px 0px;
|
margin: 10px 10px 0px;
|
||||||
padding: 10px;
|
padding: 10px;
|
||||||
.archive-article-title{
|
|
||||||
font-size: 16px;
|
|
||||||
}
|
|
||||||
.archive-year-wrap{
|
.archive-year-wrap{
|
||||||
position: relative;
|
position: relative;
|
||||||
padding: 0 0 0 0;
|
padding: 0 0 0 0;
|
||||||
|
|||||||
@ -1,54 +1,66 @@
|
|||||||
/*
|
/*
|
||||||
* 夜间模式配色
|
* 夜间模式配色
|
||||||
*/
|
*/
|
||||||
$mainBg_night: #1f2e3c; // 主背景色
|
$mainBg_night: #1f2e3c; // 主背景色
|
||||||
$articleBg_night: #15202b; // 文章背景色
|
$articleBg_night: #15202b; // 文章背景色
|
||||||
$textColor_night: #d5d5d5; // 文字颜色
|
$borderColor_night: #38444d; // 边框颜色
|
||||||
|
$textColor_night: #d5d5d5; // 文字颜色
|
||||||
body.night {
|
|
||||||
background: $mainBg_night;
|
body.night {
|
||||||
// 展开菜单之后的背景
|
background: $mainBg_night;
|
||||||
#container.show {
|
// 展开菜单之后的背景
|
||||||
background: none;
|
#container.show {
|
||||||
}
|
background: none;
|
||||||
// 主背景
|
}
|
||||||
.mid-col {
|
// 主背景
|
||||||
background: $mainBg_night;
|
.mid-col {
|
||||||
}
|
background: $mainBg_night;
|
||||||
// 文章区域
|
}
|
||||||
.article{
|
// 文章区域
|
||||||
background: $articleBg_night;
|
.article{
|
||||||
border-color: rgb(56, 68, 77);
|
background: $articleBg_night;
|
||||||
color: $textColor_night;
|
border-color: $borderColor_night;
|
||||||
.article-title { // 主标题
|
color: $textColor_night;
|
||||||
color: $colorF;
|
.article-title { // 主标题
|
||||||
}
|
color: $colorF;
|
||||||
.article-entry blockquote{ // 引用
|
}
|
||||||
background: #2c2c2c;
|
.article-entry blockquote{ // 引用
|
||||||
}
|
background: #2c2c2c;
|
||||||
h1,h2,h3,h4,h5,h6 { // 章节标题
|
}
|
||||||
color: #b8a7a7;
|
h1,h2,h3,h4,h5,h6 { // 章节标题
|
||||||
}
|
color: #b8a7a7;
|
||||||
}
|
}
|
||||||
// 左侧栏
|
}
|
||||||
.left-col {
|
// 归档列表
|
||||||
background: $articleBg_night;
|
.archives-wrap {
|
||||||
.overlay {
|
background: $articleBg_night;
|
||||||
background: none;
|
border-bottom-color: $borderColor_night;
|
||||||
}
|
.archive-article {
|
||||||
.profilepic { // 头像
|
border-color: $borderColor_night;
|
||||||
filter: brightness(30%);
|
}
|
||||||
}
|
a.archive-article-title {
|
||||||
}
|
color: $textColor_night;
|
||||||
// 看板娘
|
}
|
||||||
.waifu {
|
}
|
||||||
filter: brightness(30%);
|
// 左侧栏
|
||||||
}
|
.left-col {
|
||||||
// 评论
|
background: $articleBg_night;
|
||||||
#comments {
|
.overlay {
|
||||||
background: none;
|
background: none;
|
||||||
}
|
}
|
||||||
#footer {
|
.profilepic { // 头像
|
||||||
color: $textColor_night;
|
filter: brightness(30%);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
// 看板娘
|
||||||
|
.waifu {
|
||||||
|
filter: brightness(30%);
|
||||||
|
}
|
||||||
|
// 评论
|
||||||
|
#comments {
|
||||||
|
background: none;
|
||||||
|
}
|
||||||
|
#footer {
|
||||||
|
color: $textColor_night;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@ -55,7 +55,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
.waifu-tool {
|
.waifu-tool {
|
||||||
color: #aaa;
|
color: $colorA;
|
||||||
top: 100px;
|
top: 100px;
|
||||||
right: 10px;
|
right: 10px;
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
@ -90,17 +90,6 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/*
|
|
||||||
body.night .waifu {
|
|
||||||
color: #34495e;
|
|
||||||
filter: brightness(30%);
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
@media (max-width: 768px) {
|
|
||||||
.waifu {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@keyframes shake {
|
@keyframes shake {
|
||||||
2% {
|
2% {
|
||||||
|
|||||||
@ -1,16 +1,16 @@
|
|||||||
// const AV = require('leancloud-storage');
|
// const AV = require('leancloud-storage');
|
||||||
window.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对象的传参输入, 而不需要暴露全局变量
|
* 可以支持对于AV对象的传参输入, 而不需要暴露全局变量
|
||||||
* 但是缺少一些新功能
|
* 但是缺少一些新功能
|
||||||
*/
|
*/
|
||||||
// 评论配置
|
// 评论配置
|
||||||
const commentConfig = require("../config/comment.json");
|
const commentConfig = require("../config/comment.json")
|
||||||
|
|
||||||
if(window.yiliaConfig.isPost && commentConfig.valine.enable) {
|
import(/* webpackChunkName: "valine" */ '../lib/Valine.min').then(({ default: Valine }) => {
|
||||||
commentConfig.valine.config.path = window.location.pathname;
|
commentConfig.valine.config.path = window.location.pathname
|
||||||
// commentConfig.valine.config.av = AV;
|
// commentConfig.valine.config.av = AV;
|
||||||
new Valine(commentConfig.valine.config);
|
new Valine(commentConfig.valine.config)
|
||||||
}
|
})
|
||||||
|
|||||||
@ -14,3 +14,8 @@ Util.addLoadEvent(function() {
|
|||||||
// Viewer.init()
|
// Viewer.init()
|
||||||
Aside.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",
|
main: "./source-src/js/main.js",
|
||||||
slider: "./source-src/js/slider.js",
|
slider: "./source-src/js/slider.js",
|
||||||
mobile: ["babel-polyfill", "./source-src/js/mobile.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",
|
viewer: "./source-src/js/viewer.js",
|
||||||
waifu: "./source-src/js/waifu.js"
|
waifu: "./source-src/js/waifu.js"
|
||||||
},
|
},
|
||||||
output: {
|
output: {
|
||||||
|
publicPath: '/',
|
||||||
path: __dirname+"/source",
|
path: __dirname+"/source",
|
||||||
filename: "js/[name].[chunkhash:8].js"
|
filename: "js/[name].[chunkhash:8].js"
|
||||||
},
|
},
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user