Commit d248cba5 by liuying

webpack打包生成jsp文件配置

parent 4a0fba1a
...@@ -120,5 +120,5 @@ module.exports = { ...@@ -120,5 +120,5 @@ module.exports = {
net: 'empty', net: 'empty',
tls: 'empty', tls: 'empty',
child_process: 'empty', child_process: 'empty',
}, }
} }
...@@ -70,13 +70,14 @@ const webpackConfig = merge(baseWebpackConfig, { ...@@ -70,13 +70,14 @@ const webpackConfig = merge(baseWebpackConfig, {
new HtmlWebpackPlugin({ new HtmlWebpackPlugin({
filename: process.env.NODE_ENV === 'testing' filename: process.env.NODE_ENV === 'testing'
? 'index.html' ? 'index.html'
: path.resolve(__dirname, `../dist/${env.project.replace(/['"]/g, "")}/index.html`), : path.resolve(__dirname, `../dist/${env.project.replace(/['"]/g, "")}/index.jsp`),
template: 'index.html', template: 'index.html',
...config.webpackHtml,
inject: true, inject: true,
minify: { minify: {
removeComments: true, removeComments: true,
collapseWhitespace: true, collapseWhitespace: true,
removeAttributeQuotes: true removeAttributeQuotes: true,
// more options: // more options:
// https://github.com/kangax/html-minifier#options-quick-reference // https://github.com/kangax/html-minifier#options-quick-reference
}, },
......
...@@ -5,6 +5,25 @@ ...@@ -5,6 +5,25 @@
const path = require('path') const path = require('path')
module.exports = { module.exports = {
webpackHtml:{
jspTitle:`
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/include/taglib.jsp"%>
<%@ page isELIgnored="false"%>
`,
css:`
<%@ include file="/WEB-INF/include/css.jsp"%>
<link rel="stylesheet" href="\${ctx }/vendors/bootstrap-multiselect-master/dist/css/bootstrap-multiselect.css">
<link rel="stylesheet" href="\${ctx}/css/apps/auto-marketing/filter.css?v=\${v}" />
`,
menu:`
<%@ include file="/WEB-INF/include/menu.jsp"%>
`,
footer:`
<%@ include file="/WEB-INF/include/js.jsp"%>
<script type="text/javascript" src="\${ctx}/vendors/bootstrap-multiselect-master/dist/js/bootstrap-multiselect.js"></script>
`
},
dev: { dev: {
// Paths // Paths
assetsSubDirectory: 'static', assetsSubDirectory: 'static',
......
module.exports = { module.exports = {
"host": "'//wxapp.hotwind.net'", "host": "'//wxapp.hotwind.net'",
'project': "'crm/vue'", 'project': "'wxcrm-web/vue'",
'requestUrl': "'crm'" 'requestUrl': "'crm'"
} }
module.exports = { module.exports = {
host: "'//10.0.16.178:8080'", host: "'//10.0.16.178:8080'",
project: "'crm/vue'", project: "'crm/uat'",
requestUrl: "'crm'", requestUrl: "'crm'",
} }
<%= htmlWebpackPlugin.options.jspTitle %>
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head> <head>
...@@ -10,9 +11,17 @@ ...@@ -10,9 +11,17 @@
<script src="http://apps.bdimg.com/libs/html5shiv/3.7/html5shiv.min.js"></script> <script src="http://apps.bdimg.com/libs/html5shiv/3.7/html5shiv.min.js"></script>
<script src="http://apps.bdimg.com/libs/respond.js/1.4.2/respond.min.js"></script> <script src="http://apps.bdimg.com/libs/respond.js/1.4.2/respond.min.js"></script>
<![endif]--> <![endif]-->
<%= htmlWebpackPlugin.options.css %>
</head> </head>
<body> <body class="nav-sm">
<div id="app"></div> <div class="container body">
<!-- built files will be auto injected --> <div class="main_container">
<%= htmlWebpackPlugin.options.menu %>
<div class="right_col" role="main" style="font-size: 13px;">
<div id="app"></div>
</div>
</div>
</div>
</body> </body>
<%= htmlWebpackPlugin.options.footer %>
</html> </html>
<template> <template>
<div class="wrapper"> <div class="wrapper">
<home-sidebar></home-sidebar> <!-- <home-sidebar></home-sidebar> -->
<section class="main"> <section class="main">
<home-header></home-header> <!-- <home-header></home-header> -->
<div class="content-box"> <div class="content-box">
<menus-edit /> <!-- <menus-edit /> -->
<div class="content"> <div class="content-c">
<transition name="move" mode="out-in"> <transition name="move" mode="out-in">
<!-- <keep-alive exclude="prize"> --> <!-- <keep-alive exclude="prize"> -->
<router-view></router-view> <router-view></router-view>
...@@ -18,22 +18,14 @@ ...@@ -18,22 +18,14 @@
</template> </template>
<script> <script>
import { mapActions } from 'vuex' import { mapActions } from 'vuex'
import HomeSidebar from 'components/Sidebar'
import HomeHeader from 'components/Header'
import menusEdit from 'components/menus/edit'
export default { export default {
data () { data () {
return { return {
} }
}, },
components: {
HomeSidebar,
HomeHeader,
menusEdit
},
created () { created () {
this.getMenus() // this.getMenus()
}, },
methods: { methods: {
...mapActions([ ...mapActions([
...@@ -53,18 +45,13 @@ export default { ...@@ -53,18 +45,13 @@ export default {
display flex display flex
position relative position relative
.content-box .content-box
/*position absolute*/
display inline-block display inline-block
flex 1 flex 1
margin-top 58px
/*top 58px*/
/*bottom 0*/
width 80% width 80%
-webkit-transition left 0.3s ease-in-out -webkit-transition left 0.3s ease-in-out
transition left 0.3s ease-in-out transition left 0.3s ease-in-out
background #F3F2F8 background #F3F2F8
min-height 720px min-height 720px
.content .content-c
width auto width auto
padding 15px
</style> </style>
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
<img src="@/assets/images/temp.png"> <img src="@/assets/images/temp.png">
</span> </span>
<p class="icon-wechat-msg title-center">营销模板消息</p> <p class="icon-wechat-msg title-center">营销模板消息</p>
</div> </div>
</div> </div>
</el-col> </el-col>
<el-col :span="10" class="button-right"> <el-col :span="10" class="button-right">
...@@ -175,7 +175,7 @@ export default { ...@@ -175,7 +175,7 @@ export default {
.left-icon .left-icon
height 140px height 140px
.icon-left .icon-left
width 50% width 20%
.icon-right, .icon-left .icon-right, .icon-left
padding 20px 0 padding 20px 0
text-align center text-align center
......
...@@ -7,14 +7,9 @@ export default new Router({ ...@@ -7,14 +7,9 @@ export default new Router({
base: `/${config.project}/`, base: `/${config.project}/`,
routes: [ routes: [
{ {
path: '/login',
name: 'Login',
component: () => import(/* webpackChunkName: 'wxlogin' */ '@/pages/login'),
},
{
// path: '/salesCenter/activity/lotteryActivity.do', // path: '/salesCenter/activity/lotteryActivity.do',
path: '/', path: '/',
name: 'test', name: 'home',
component: () => import(/* web packChunkName: 'wxhome' */ '@/pages/home'), component: () => import(/* web packChunkName: 'wxhome' */ '@/pages/home'),
children: [ children: [
{ {
......
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