Commit 6a9f4c68 authored by “yiyousong”'s avatar “yiyousong”
parents bb6f31b4 4eb65072
......@@ -34,15 +34,7 @@ const assetsCDN = {
],
};
const HardSourceWebpackPlugin = require('hard-source-webpack-plugin');
const devPlugins = [
new HardSourceWebpackPlugin(),
new HardSourceWebpackPlugin.ExcludeModulePlugin([
{
test: /mini-css-extract-plugin[\\/]dist[\\/]loader/
}
])
];
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin
module.exports = {
......@@ -67,69 +59,7 @@ module.exports = {
patterns: [path.resolve(__dirname, "./src/theme/theme.less")],
},
},
configureWebpack: (config) => {
config.plugin('webpack-report').use(BundleAnalyzerPlugin, [
{
analyzerMode: 'static'
}
])
plugins: process.env.NODE_ENV === "production" ? [] : [...devPlugins];
config.entry.app = ["babel-polyfill", "whatwg-fetch", "./src/main.js"];
config.performance = {
hints: false,
};
config.plugins.push(
new ThemeColorReplacer({
fileName: "css/theme-colors-[contenthash:8].css",
matchColors: getThemeColors(),
injectCss: true,
resolveCss,
})
);
config.plugins.push(
// 控制富文本图片大小
new webpack.ProvidePlugin({
"window.Quill": "quill/dist/quill.js",
Quill: "quill/dist/quill.js",
})
);
// Ignore all locale files of moment.js
// config.plugins.push(new webpack.IgnorePlugin(/^\.\/locale$/, /moment$/))
// 生产环境下将资源压缩成gzip格式
if (isProd) {
// add `CompressionWebpack` plugin to webpack plugins
config.plugins.push(
new CompressionWebpackPlugin({
algorithm: "gzip",
test: new RegExp("\\.(" + productionGzipExtensions.join("|") + ")$"),
threshold: 10240,
minRatio: 0.8,
})
);
}
// if prod, add externals
if (isProd) {
config.externals = assetsCDN.externals;
}
},
chainWebpack: (config) => {
// 生产环境下关闭css压缩的 colormin 项,因为此项优化与主题色替换功能冲突
if (isProd) {
config.plugin("optimize-css").tap((args) => {
args[0].cssnanoOptions.preset[1].colormin = false;
return args;
});
}
// 生产环境下使用CDN
// if (isProd) {
// config.plugin('html')
// .tap(args => {
// args[0].cdn = assetsCDN
// return args
// })
// }
},
css: {
loaderOptions: {
less: {
......
......@@ -61,11 +61,33 @@
<skipUi>true</skipUi>
</properties>
</profile>
<profile>
<id>yibin-test</id>
<properties>
<profiles.active>yibin-test</profiles.active>
<profiles.server.path>/base</profiles.server.path>
<profiles.publish.path>/home/publish</profiles.publish.path>
<profiles.rabbitmq.host>127.0.0.1</profiles.rabbitmq.host>
<profiles.rabbitmq.port>5672</profiles.rabbitmq.port>
<profiles.rabbitmq.username>taxi_mq</profiles.rabbitmq.username>
<profiles.rabbitmq.password>admin@2020</profiles.rabbitmq.password>
<profiles.rabbitmq.virtualhost>/</profiles.rabbitmq.virtualhost>
<profiles.nacos.server-addr>127.0.0.1:8848</profiles.nacos.server-addr>
<profiles.nacos.group>DEFAULT_GROUP</profiles.nacos.group>
<profiles.nacos.namespace>smart-gov</profiles.nacos.namespace>
<profiles.log.path>/home/mortals/app/logs</profiles.log.path>
<profiles.log.level>INFO</profiles.log.level>
<package.environment>test</package.environment>
<skipUi>false</skipUi>
</properties>
</profile>
<profile>
<id>product</id>
<properties>
<profiles.active>test</profiles.active>
<profiles.active>product</profiles.active>
<profiles.server.path>/base</profiles.server.path>
<profiles.server.port>17211</profiles.server.port>
<profiles.publish.path>/home/publish</profiles.publish.path>
<profiles.rabbitmq.host>192.168.0.251</profiles.rabbitmq.host>
<profiles.rabbitmq.port>5672</profiles.rabbitmq.port>
......@@ -87,6 +109,7 @@
<properties>
<profiles.active>yibin</profiles.active>
<profiles.server.path>/base</profiles.server.path>
<profiles.server.port>17211</profiles.server.port>
<profiles.publish.path>/home/publish</profiles.publish.path>
<profiles.rabbitmq.host>172.15.28.115</profiles.rabbitmq.host>
<profiles.rabbitmq.port>5672</profiles.rabbitmq.port>
......
#!/bin/bash
PORT="@profiles.server.port@"
PROJECT_NAME="@project.artifactId@";
MAIN_CLASS="$PROJECT_NAME-@project.version@.jar";
SHELL_NAME=$0
SHELL_LOG="${SHELL_NAME}.log"
LOG_DATE='date "+%Y-%m-%d"'
LOG_TIME='date "+%H-%M-%S"'
CDATE=$(date "+%Y-%m-%d")
CTIME=$(date "+%H-%M-%S")
#写日志
writelog() {
LOGINFO=$1
echo "${CDATE} ${CTIME}: ${SHELL_NAME} : ${LOGINFO}" >>${SHELL_LOG}
}
jcpid=`ps -ef | grep -v "grep" | grep "$MAIN_CLASS" | grep "app.port=$PORT" | sed -n '1P' | awk '{print $2}'`
if [ $jcpid ]; then
writelog "The $PROJECT_NAME start finished, PID is $jcpid"
exit $SUCCESS
else
writelog "start service..."
systemctl stop ${PROJECT_NAME} && systemctl start ${PROJECT_NAME}
fi
#! /bin/sh
#!/bin/sh
PORT="@profiles.server.port@"
BASEDIR=`dirname $0`
BASEDIR=`(cd "$BASEDIR"; pwd)`
PROJECT_NAME="@project.artifactId@"
MAIN_CLASS="$PROJECT_NAME";
SUCCESS=0
FAIL=9
if [ ! -n "$PORT" ]; then
echo $"Usage: $0 {port}"
exit $FAIL
......@@ -14,7 +15,7 @@ fi
pid=`ps ax | grep -i "$MAIN_CLASS" | grep java | grep -v grep | awk '{print $1}'`
if [ -z "$pid" ] ; then
echo "No Server running."
exit -1;
exit $FAIL;
fi
echo "stoping application $PROJECT_NAME......"
......
#!/bin/sh
PORT="@profiles.server.port@"
source /etc/profile
BASEDIR=`dirname $0`/..
BASEDIR=`(cd "$BASEDIR"; pwd)`
PROJECT_NAME="@project.artifactId@";
......
......@@ -46,7 +46,7 @@ public class MatterController extends BaseCRUDJsonBodyMappingController<MatterSe
private ParamService paramService;
@Autowired
private InterceptorConfig interceptorConfig;
@Autowired
private SiteThemeService siteThemeService;
public MatterController() {
......
......@@ -57,6 +57,28 @@
<skipUi>true</skipUi>
</properties>
</profile>
<profile>
<id>yibin-test</id>
<properties>
<profiles.active>yibin-test</profiles.active>
<profiles.server.path>/zwfw</profiles.server.path>
<profiles.publish.path>/home/publish</profiles.publish.path>
<profiles.rabbitmq.host>127.0.0.1</profiles.rabbitmq.host>
<profiles.rabbitmq.port>5672</profiles.rabbitmq.port>
<profiles.rabbitmq.username>taxi_mq</profiles.rabbitmq.username>
<profiles.rabbitmq.password>admin@2020</profiles.rabbitmq.password>
<profiles.rabbitmq.virtualhost>/</profiles.rabbitmq.virtualhost>
<profiles.nacos.server-addr>127.0.0.1:8848</profiles.nacos.server-addr>
<profiles.nacos.group>DEFAULT_GROUP</profiles.nacos.group>
<profiles.nacos.namespace>smart-gov</profiles.nacos.namespace>
<profiles.log.level>INFO</profiles.log.level>
<profiles.log.path>/home/mortals/app/logs</profiles.log.path>
<package.environment>test</package.environment>
<skipUi>false</skipUi>
</properties>
</profile>
<profile>
<id>product</id>
<properties>
......
......@@ -59,6 +59,28 @@
</properties>
</profile>
<profile>
<id>yibin-test</id>
<properties>
<profiles.active>yibin-test</profiles.active>
<profiles.server.ip>127.0.0.1</profiles.server.ip>
<profiles.server.port>17214</profiles.server.port>
<profiles.nginx.port>11078</profiles.nginx.port>
<profiles.rabbitmq.host>127.0.0.1</profiles.rabbitmq.host>
<profiles.rabbitmq.port>5672</profiles.rabbitmq.port>
<profiles.rabbitmq.username>taxi_mq</profiles.rabbitmq.username>
<profiles.rabbitmq.password>admin@2020</profiles.rabbitmq.password>
<profiles.rabbitmq.virtualhost>/</profiles.rabbitmq.virtualhost>
<profiles.nacos.server-addr>127.0.0.1:8848</profiles.nacos.server-addr>
<profiles.nacos.group>DEFAULT_GROUP</profiles.nacos.group>
<profiles.nacos.namespace>smart-gov</profiles.nacos.namespace>
<profiles.log.level>INFO</profiles.log.level>
<profiles.log.path>/home/mortals/app/logs</profiles.log.path>
<profiles.publish.path>/home/publish</profiles.publish.path>
</properties>
</profile>
<profile>
<id>product</id>
<properties>
......
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