Commit d248cba5 by liuying

webpack打包生成jsp文件配置

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