Commit e9b2922b by 阳浪

添加配置文件

parent 16a2e3b2
{
"presets": [
[
"@babel/preset-env",
{
"targets":{
"browsers":["last 2 versions"]
},
// "debug":true
}
],
"@babel/preset-react"
],
"plugins": [
"@babel/plugin-proposal-object-rest-spread",
"@babel/plugin-syntax-dynamic-import",
["@babel/plugin-proposal-decorators", { "legacy": true }],
["@babel/plugin-proposal-class-properties", { "loose": true }],
["import", { "libraryName": "antd", "libraryDirectory": "es" }],
"react-hot-loader/babel",
"@babel/plugin-transform-runtime"
]
}
{
"parser": "babel-eslint",
"plugins": [
"react",
"jsx-a11y"
],
"parserOptions": {
"ecmaFeatures": {
"jsx": true
}
},
"rules": {
"semi": 2
}
}
...@@ -53,7 +53,7 @@ module.exports = { ...@@ -53,7 +53,7 @@ module.exports = {
} }
}, },
plugins: [ plugins: [
new HtmlWebpackPlugin(generateHtml("index", "未木云学习平台")), new HtmlWebpackPlugin(generateHtml("index", "机电e先锋智慧党建平台")),
new webpack.DefinePlugin({ new webpack.DefinePlugin({
"process.env.NODE_ENV": JSON.stringify(process.env.NODE_ENV), "process.env.NODE_ENV": JSON.stringify(process.env.NODE_ENV),
routerMode: JSON.stringify("hash") routerMode: JSON.stringify("hash")
......
...@@ -50,12 +50,12 @@ module.exports = { ...@@ -50,12 +50,12 @@ module.exports = {
} }
}, },
plugins: [ plugins: [
new HtmlWebpackPlugin(generateHtml("index", "未木云学习平台")), new HtmlWebpackPlugin(generateHtml("index", "机电e先锋智慧党建平台")),
new webpack.DefinePlugin({ new webpack.DefinePlugin({
"process.env.NODE_ENV": JSON.stringify(process.env.NODE_ENV), "process.env.NODE_ENV": JSON.stringify(process.env.NODE_ENV),
routerMode: JSON.stringify("hash") routerMode: JSON.stringify("hash")
}), }),
], ],
optimization: { optimization: {
splitChunks: { splitChunks: {
...@@ -76,12 +76,12 @@ module.exports = { ...@@ -76,12 +76,12 @@ module.exports = {
vendors: { vendors: {
test: /[\\/]node_modules[\\/]/, test: /[\\/]node_modules[\\/]/,
priority: -10 priority: -10
}, },
default: { default: {
minChunks: 2, minChunks: 2,
priority: -20, priority: -20,
reuseExistingChunk: true reuseExistingChunk: true
} }
} }
} }
} }
......
...@@ -8,7 +8,7 @@ const TerserPlugin = require("terser-webpack-plugin"); ...@@ -8,7 +8,7 @@ const TerserPlugin = require("terser-webpack-plugin");
const common = require("./webpack.base.config.js"); const common = require("./webpack.base.config.js");
const ProgressBarPlugin = require("progress-bar-webpack-plugin"); const ProgressBarPlugin = require("progress-bar-webpack-plugin");
module.exports = merge(common, { module.exports = merge(common, {
mode: "production", mode: "production",
module: { module: {
rules: [{ rules: [{
enforce: "pre", enforce: "pre",
...@@ -56,30 +56,30 @@ module.exports = merge(common, { ...@@ -56,30 +56,30 @@ module.exports = merge(common, {
] ]
}, },
performance: { performance: {
hints: "warning", hints: "warning",
maxAssetSize: 30000000, maxAssetSize: 30000000,
maxEntrypointSize: 50000000, maxEntrypointSize: 50000000,
assetFilter: function(assetFilename) { assetFilter: function(assetFilename) {
return assetFilename.endsWith(".css") || assetFilename.endsWith(".js"); return assetFilename.endsWith(".css") || assetFilename.endsWith(".js");
}, },
}, },
optimization: { optimization: {
minimize: true, minimize: true,
minimizer: [ minimizer: [
new TerserPlugin({ new TerserPlugin({
sourceMap: true, // Must be set to true if using source-maps in production sourceMap: true, // Must be set to true if using source-maps in production
terserOptions: { terserOptions: {
output: { output: {
}, },
parallel: true, parallel: true,
cache: true, cache: true,
drop_console: true, drop_console: true,
drop_debugger: false, drop_debugger: false,
pure_funcs: ['console.log','Warning','warnings','debugger'], // 移除console pure_funcs: ['console.log','Warning','warnings','debugger'], // 移除console
} }
}) })
] ]
} }
}); });
<cross-domain-policy>
<allow-access-from domain="*.polyv.net"/>
</cross-domain-policy>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta http-equiv="x-ua-compatible" content="IE=edge, chrome=1">
<meta name="viewport" content="width=device-width,initial-scale=1">
<link id="faviconLink" rel="shortcut icon" href="/static/favicon.ico">
<link href="/static/lib/antd.min.css" rel="stylesheet" type="text/css">
<!--需要title 国际化 代码在/src/index.jsx 中获取修改-->
<title id="htmlTitle"></title>
<!--<title id="htmlTitle">未木云学习平台</title>-->
</head>
<body>
<div id="root"></div>
<script>
//30分钟不操作退回登陆页
var move = document.getElementById('root')
function onmove() {
console.log(window.location)
var path = window.location.pathname
var login = '/' + window.location.pathname.split("/")[1] + '/' + window.location.pathname.split("/")[2] + '/login'
if (path.substring(path.length - 5) !== 'login') {
sessionStorage.clear()
window.location.href = window.location.origin + login
}
}
function debounce(func, wait) {
var timeout;
return function () {
var context = this;
var args = arguments;
if (timeout) clearTimeout(timeout);
timeout = window.setTimeout(function () {
func.apply(context, args)
}, wait);
}
}
move.onmousemove = debounce(onmove, 7200000);
if (typeof Object.assign != 'function') {
Object.assign = function (target) {
'use strict';
if (target == null) {
throw new TypeError('Cannot convert undefined or null to object');
}
target = Object(target);
for (var index = 1; index < arguments.length; index++) {
var source = arguments[index];
if (source != null) {
for (var key in source) {
if (Object.prototype.hasOwnProperty.call(source, key)) {
target[key] = source[key];
}
}
}
}
return target;
};
}
if (typeof "".includes != 'function') {
String.prototype.includes = function (str) {
if(this.indexOf(str)!=-1){
return true;
}else{
return false;
}
}
}
if (typeof [].includes != 'function') {
Array.prototype.includes = function (str) {
if(this.indexOf(str)!=-1){
return true;
}else{
return false;
}
}
}
if (typeof [].fill != 'function') {
Array.prototype.fill = function (str) {
for(var i = 0;i<this.length;i++){
this[i] = str;
}
return this;
}
}
// if (typeof [].entries != 'function') {
// Array.prototype.entries = function (str) {
// for(var i = 0;i<this.length;i++){
// this[i] = str;
// }
// return this;
// }
// }
</script>
<script type="text/javascript" src="/static/lib/crypto1/crypto/crypto.js"></script>
<script type="text/javascript" src="/static/lib/crypto1/hmac/hmac.js"></script>
<script type="text/javascript" src="/static/lib/crypto1/sha1/sha1.js"></script>
<script type="text/javascript" src="/static/lib/base64.js"></script>
<script type="text/javascript" src="/static/variable.js"></script>
<script type="text/javascript" src="/static/lib/sm2.min.js"></script>
<script type="text/javascript" src="/static/lib/es6-promise.auto.min.js"></script>
<script type="text/javascript" src="/js/styles.558ae8.js"></script><script type="text/javascript" src="/js/index.558ae8.js"></script><script type="text/javascript" src="/js/vendor.558ae8.js"></script></body>
</html>
\ No newline at end of file
<!DOCTYPE html>
<html lang="cn">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,minimum-scale=1">
<title>站点维护中</title>
<style>
body,
html {
width: 100%;
margin: 0;
padding: 0;
}
.site-maintain-container {
max-width: 1200px;
width: 100%;
margin: 0 auto;
text-align: center;
}
.site-maintain-container img {
width: 450px;
height: 341px;
margin-top: 160px;
}
.site-maintain-tip-text {
width: 655px;
text-align: center;
margin: 0 auto;
margin-top: 20px;
font-size: 30px;
font-weight: 500;
color: #666666;
line-height: 42px;
letter-spacing: 1px;
}
@media screen and (max-width: 600px) {
body,
html {
width: 100%;
margin: 0;
padding: 0;
}
.site-maintain-container {
width: 100%;
margin: 0 auto;
text-align: center;
}
.site-maintain-container img {
width: 215px;
height: 171px;
margin-top: 135px;
}
.site-maintain-tip-text {
width: 100%;
text-align: center;
margin: 0 auto;
margin-top: 20px;
font-size: 14px;
font-weight: 500;
color: #999;
line-height: 20px;
letter-spacing: 1px;
word-break: break-all;
}
}
</style>
</head>
<body>
<div class="site-maintain-container">
<img src="https://customproject.oss-cn-shanghai.aliyuncs.com/photo/site_maintenance.png" alt="">
<div class="site-maintain-tip-text">
</div>
</div>
<script>
function getUrlParam(code){
var searchText = window.location.search.split("?")[1].split("&");
var result = "";
for(var i = 0;i<searchText.length;i++){
var arr = searchText[i].split("=");
if(arr[0]==code){
result = arr[1];
break;
}
}
return result;
}
window.onload = function () {
var textDom = document.querySelector(".site-maintain-tip-text");
var text = getUrlParam("text");
textDom.innerHTML = decodeURIComponent(text)||"站点维护中,给您的学习带来不便,敬请谅解";
}
</script>
</body>
</html>
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment