mirror of
https://gitee.com/wangkang/udf.git
synced 2026-10-28 16:23:42 +00:00
瘦身
This commit is contained in:
@@ -24,6 +24,14 @@ module.exports = {
|
||||
entry: {
|
||||
app: ['babel-polyfill','./src/main.js']
|
||||
},
|
||||
// 在这个位置添加externals设置:
|
||||
externals: {
|
||||
'vue': 'Vue',
|
||||
'vue-router': 'VueRouter',
|
||||
'element-ui': 'ELEMENT',
|
||||
'axios': 'Axios',
|
||||
'nprogress':'NProgress'
|
||||
},
|
||||
output: {
|
||||
path: config.build.assetsRoot,
|
||||
filename: '[name].js',
|
||||
|
||||
@@ -64,7 +64,7 @@ module.exports = {
|
||||
// Surge or Netlify already gzip all static assets for you.
|
||||
// Before setting to `true`, make sure to:
|
||||
// npm install --save-dev compression-webpack-plugin
|
||||
productionGzip: false,
|
||||
productionGzip: true,
|
||||
productionGzipExtensions: ['js', 'css'],
|
||||
|
||||
// Run the build command with an extra argument to
|
||||
|
||||
@@ -4,6 +4,13 @@
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||
<link rel="stylesheet" href="https://unpkg.com/element-ui@2.13.1/lib/theme-chalk/index.css">
|
||||
<link rel="stylesheet" href="https://unpkg.com/nprogress@0.2.0/nprogress.css">
|
||||
<script src="https://unpkg.com/vue@2.6.11/dist/vue.js"></script>
|
||||
<script src="https://unpkg.com/vue-router@3.1.6/dist/vue-router.min.js"></script>
|
||||
<script src="https://unpkg.com/element-ui@2.13.1/lib/index.js"></script>
|
||||
<script src="https://unpkg.com/axios@0.19.2/dist/axios.min.js"></script>
|
||||
<script src="https://unpkg.com/nprogress@0.2.0/nprogress.js"></script>
|
||||
<link rel="icon" href="favicon.ico">
|
||||
<title><%=process.env.VUE_APP_TITLE%></title>
|
||||
<style>
|
||||
|
||||
+2
-7
@@ -13,13 +13,7 @@
|
||||
"build": "node build/build.js"
|
||||
},
|
||||
"dependencies": {
|
||||
"axios": "^0.19.2",
|
||||
"babel-polyfill": "^6.26.0",
|
||||
"element-ui": "^2.13.1",
|
||||
"nprogress": "^0.2.0",
|
||||
"vue": "^2.6.11",
|
||||
"vue-axios": "^2.1.5",
|
||||
"vue-router": "^3.1.6"
|
||||
"babel-polyfill": "^6.26.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"autoprefixer": "^7.1.2",
|
||||
@@ -36,6 +30,7 @@
|
||||
"babel-register": "^6.22.0",
|
||||
"chalk": "^2.0.1",
|
||||
"chromedriver": "^2.27.2",
|
||||
"compression-webpack-plugin": "^1.1.2",
|
||||
"copy-webpack-plugin": "^4.0.1",
|
||||
"cross-spawn": "^5.0.1",
|
||||
"css-loader": "^0.28.0",
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import axios from 'axios'
|
||||
import glob from '../assets/js/glob.js';
|
||||
|
||||
const api_user = {
|
||||
|
||||
@@ -1,9 +1,5 @@
|
||||
import Vue from 'vue'
|
||||
import NProgress from 'nprogress';
|
||||
import 'nprogress/nprogress.css';
|
||||
import router from "../../router";
|
||||
import axios from 'axios';
|
||||
import {Message} from 'element-ui';
|
||||
import { Message } from 'element-ui';
|
||||
|
||||
const glob = {
|
||||
//token名称
|
||||
|
||||
@@ -1,104 +0,0 @@
|
||||
// element引入列表
|
||||
//完整组件参照 : https://github.com/ElemeFE/element/blob/master/components.json
|
||||
import Vue from 'vue';
|
||||
import 'element-ui/lib/theme-chalk/index.css';
|
||||
import './assets/scss/element-variables.scss';
|
||||
import {
|
||||
Aside,
|
||||
Backtop,
|
||||
Badge,
|
||||
Button,
|
||||
ButtonGroup,
|
||||
Card,
|
||||
Container,
|
||||
Divider,
|
||||
Dropdown,
|
||||
DropdownItem,
|
||||
DropdownMenu,
|
||||
Footer,
|
||||
Header,
|
||||
Input,
|
||||
Loading,
|
||||
Main,
|
||||
Message,
|
||||
MessageBox,
|
||||
Notification,
|
||||
Scrollbar,
|
||||
Transfer
|
||||
} from 'element-ui';
|
||||
|
||||
Vue.use(Backtop);
|
||||
Vue.use(Dropdown);
|
||||
Vue.use(DropdownItem);
|
||||
Vue.use(Button);
|
||||
Vue.use(ButtonGroup);
|
||||
Vue.use(Badge);
|
||||
Vue.use(Card);
|
||||
Vue.use(Transfer);
|
||||
Vue.use(Container);
|
||||
Vue.use(Header);
|
||||
Vue.use(Aside);
|
||||
Vue.use(Main);
|
||||
Vue.use(Footer);
|
||||
Vue.use(Scrollbar);
|
||||
Vue.use(Divider);
|
||||
Vue.use(Loading.directive);
|
||||
Vue.use(DropdownMenu);
|
||||
Vue.use(Input);
|
||||
// Vue.use(Pagination);
|
||||
// Vue.use(Dialog);
|
||||
// Vue.use(Autocomplete);
|
||||
// Vue.use(Menu);
|
||||
// Vue.use(Submenu);
|
||||
// Vue.use(MenuItem);
|
||||
// Vue.use(MenuItemGroup);
|
||||
// Vue.use(InputNumber);
|
||||
// Vue.use(Radio);
|
||||
// Vue.use(RadioGroup);
|
||||
// Vue.use(RadioButton);
|
||||
// Vue.use(Checkbox);
|
||||
// Vue.use(CheckboxButton);
|
||||
// Vue.use(CheckboxGroup);
|
||||
// Vue.use(Switch);
|
||||
// Vue.use(Select);
|
||||
// Vue.use(Option);
|
||||
// Vue.use(OptionGroup);
|
||||
// Vue.use(Table);
|
||||
// Vue.use(TableColumn);
|
||||
// Vue.use(DatePicker);
|
||||
// Vue.use(TimeSelect);
|
||||
// Vue.use(TimePicker);
|
||||
// Vue.use(Popover);
|
||||
// Vue.use(Tooltip);
|
||||
// Vue.use(Breadcrumb);
|
||||
// Vue.use(BreadcrumbItem);
|
||||
// Vue.use(Form);
|
||||
// Vue.use(FormItem);
|
||||
// Vue.use(Tabs);
|
||||
// Vue.use(TabPane);
|
||||
// Vue.use(Tag);
|
||||
// Vue.use(Tree);
|
||||
// Vue.use(Alert);
|
||||
// Vue.use(Slider);
|
||||
// Vue.use(Icon);
|
||||
// Vue.use(Row);
|
||||
// Vue.use(Col);
|
||||
// Vue.use(Upload);
|
||||
// Vue.use(Progress);
|
||||
// Vue.use(Rate);
|
||||
// Vue.use(Steps);
|
||||
// Vue.use(Step);
|
||||
// Vue.use(Carousel);
|
||||
// Vue.use(CarouselItem);
|
||||
// Vue.use(Collapse);
|
||||
// Vue.use(CollapseItem);
|
||||
// Vue.use(Cascader);
|
||||
// Vue.use(ColorPicker);
|
||||
|
||||
Vue.prototype.$loading = Loading.service;
|
||||
Vue.prototype.$msgbox = MessageBox;
|
||||
Vue.prototype.$alert = MessageBox.alert;
|
||||
Vue.prototype.$confirm = MessageBox.confirm;
|
||||
Vue.prototype.$prompt = MessageBox.prompt;
|
||||
Vue.prototype.$notify = Notification;
|
||||
Vue.prototype.$message = Message;
|
||||
@@ -1,11 +1,7 @@
|
||||
// The Vue build version to load with the `import` command
|
||||
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
|
||||
import Vue from 'vue'
|
||||
import App from './App'
|
||||
import router from './router'
|
||||
import './element'
|
||||
import axios from 'axios';
|
||||
import VueAxios from 'vue-axios';
|
||||
import "babel-polyfill";
|
||||
import './assets/css/reset.css';
|
||||
import './assets/css/bootstrap.css';
|
||||
@@ -14,7 +10,6 @@ import glob from './assets/js/glob.js';
|
||||
|
||||
//use
|
||||
Vue.config.productionTip = false;
|
||||
Vue.use(VueAxios, axios);
|
||||
//init
|
||||
glob.inti();
|
||||
/* eslint-disable no-new */
|
||||
|
||||
@@ -1,9 +1,4 @@
|
||||
import Vue from 'vue'
|
||||
import Router from 'vue-router'
|
||||
|
||||
Vue.use(Router)
|
||||
|
||||
export default new Router({
|
||||
export default new VueRouter({
|
||||
routes: [
|
||||
{
|
||||
path: '/',
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
import Vue from 'vue'
|
||||
import HelloWorld from '@/components/HelloWorld'
|
||||
|
||||
describe('HelloWorld.vue', () => {
|
||||
it('should render correct contents', () => {
|
||||
const Constructor = Vue.extend(HelloWorld)
|
||||
const vm = new Constructor().$mount()
|
||||
expect(vm.$el.querySelector('.hello h1').textContent)
|
||||
|
||||
})
|
||||
})
|
||||
Reference in New Issue
Block a user