refactor: 前端分开构建
This commit is contained in:
parent
8635886cde
commit
c7cb74be3a
|
@ -55,12 +55,30 @@
|
|||
</execution>
|
||||
<!-- Build and minify static files -->
|
||||
<execution>
|
||||
<id>yarn build</id>
|
||||
<id>yarn build business</id>
|
||||
<goals>
|
||||
<goal>yarn</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<arguments>build</arguments>
|
||||
<arguments>build business</arguments>
|
||||
</configuration>
|
||||
</execution>
|
||||
<execution>
|
||||
<id>yarn build login</id>
|
||||
<goals>
|
||||
<goal>yarn</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<arguments>build login</arguments>
|
||||
</configuration>
|
||||
</execution>
|
||||
<execution>
|
||||
<id>yarn build document</id>
|
||||
<goals>
|
||||
<goal>yarn</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<arguments>build document</arguments>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import Vue from 'vue';
|
||||
import {Button, Col, Form, FormItem, Input, Row, RadioGroup} from 'element-ui';
|
||||
import {Button, Col, Form, FormItem, Input, Row, RadioGroup, Radio} from 'element-ui';
|
||||
import 'element-ui/lib/theme-chalk/index.css';
|
||||
import Login from "./Login.vue";
|
||||
import Ajax from "../common/js/ajax";
|
||||
|
@ -18,6 +18,7 @@ Vue.use(FormItem);
|
|||
Vue.use(Input);
|
||||
Vue.use(Button);
|
||||
Vue.use(RadioGroup);
|
||||
Vue.use(Radio);
|
||||
Vue.use(Ajax);
|
||||
|
||||
|
||||
|
|
|
@ -1,23 +1,12 @@
|
|||
const path = require('path')
|
||||
const path = require('path');
|
||||
|
||||
function resolve(dir) {
|
||||
return path.join(__dirname, dir)
|
||||
return path.join(__dirname, dir);
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
productionSourceMap: false,
|
||||
devServer: {
|
||||
port: 8080,
|
||||
proxy: {
|
||||
//1.8需求:增加分享功能,不登陆即可看到文档页面。所以代理设置增加了(?!/document)文档页面的相关信息
|
||||
// ['^(?!/login)']: {
|
||||
['^((?!/login)(?!/document))']: {
|
||||
target: 'http://localhost:8081',
|
||||
ws: true,
|
||||
},
|
||||
}
|
||||
},
|
||||
pages: {
|
||||
let projectName = process.argv[3];
|
||||
|
||||
const projects = {
|
||||
business: {
|
||||
entry: "src/business/main.js",
|
||||
template: "src/business/index.html",
|
||||
|
@ -33,7 +22,34 @@ module.exports = {
|
|||
template: "src/document/document.html",
|
||||
filename: "document.html"
|
||||
}
|
||||
};
|
||||
|
||||
const getPage = function (projectName) {
|
||||
if (!projectName) {
|
||||
return projects;
|
||||
}
|
||||
return {
|
||||
[projectName]: projects[projectName]
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
let pages = getPage(projectName);
|
||||
|
||||
module.exports = {
|
||||
productionSourceMap: false,
|
||||
devServer: {
|
||||
port: 8080,
|
||||
proxy: {
|
||||
//1.8需求:增加分享功能,不登陆即可看到文档页面。所以代理设置增加了(?!/document)文档页面的相关信息
|
||||
// ['^(?!/login)']: {
|
||||
['^((?!/login)(?!/document))']: {
|
||||
target: 'http://localhost:8081',
|
||||
ws: true,
|
||||
},
|
||||
}
|
||||
},
|
||||
pages: pages,
|
||||
configureWebpack: {
|
||||
devtool: 'source-map',
|
||||
resolve: {
|
||||
|
@ -43,6 +59,6 @@ module.exports = {
|
|||
}
|
||||
},
|
||||
chainWebpack(config) {
|
||||
config.plugins.delete('prefetch')
|
||||
config.plugins.delete('prefetch');
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue