Skip to content

Commit

Permalink
optimize production build
Browse files Browse the repository at this point in the history
  • Loading branch information
grzhan committed Sep 10, 2017
1 parent 1543401 commit 532f447
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 5 deletions.
7 changes: 6 additions & 1 deletion .babelrc
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,12 @@
}],
"stage-2"
],
"plugins": ["transform-runtime"],
"plugins": ["transform-runtime", ["component", [
{
"libraryName": "element-ui",
"styleLibraryName": "~theme"
}
]]],
"env": {
"test": {
"presets": ["env", "stage-2"],
Expand Down
2 changes: 1 addition & 1 deletion config/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ module.exports = {
assetsRoot: path.resolve(__dirname, '../dist'),
assetsSubDirectory: 'static',
assetsPublicPath: '/',
productionSourceMap: true,
productionSourceMap: false,
// Gzip off by default as many popular static hosts such as
// Surge or Netlify already gzip all static assets for you.
// Before setting to `true`, make sure to:
Expand Down
1 change: 1 addition & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
<title>上海大学开源社区 | 主页</title>
<link rel="shortcut icon" href="static/favicon.ico">
<meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
</head>
<body>
<div id="app"></div>
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
"babel-core": "^6.22.1",
"babel-eslint": "^7.1.1",
"babel-loader": "^7.1.1",
"babel-plugin-component": "^0.10.0",
"babel-plugin-transform-runtime": "^6.22.0",
"babel-preset-env": "^1.3.2",
"babel-preset-stage-2": "^6.22.0",
Expand Down
2 changes: 1 addition & 1 deletion src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@
.title.text-center 社区成员
.hr.element-center
el-carousel(:type="carouselType" height="400px", :interval="6000")
el-carousel-item.card(v-for="member in members")
el-carousel-item.card(v-for="member in members", :key="member.name")
img.avatar(:src="member.avatar")
.name {{member.name}}
.title {{member.title}}
Expand Down
9 changes: 7 additions & 2 deletions src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,20 @@
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue'
import App from './App'
import ElementUI from 'element-ui'
import {Button, Icon, Col, Row, Carousel, CarouselItem} from 'element-ui'
import '../theme/index.css'
import FlatSurfaceShader from 'vue-flat-surface-shader'
import headroom from 'vue-headroom'
import ScrollSpy from './lib/Scrollspy'
require('../node_modules/font-awesome/css/font-awesome.css')

Vue.config.productionTip = false
Vue.use(ElementUI)
Vue.use(Button)
Vue.use(Icon)
Vue.use(Col)
Vue.use(Row)
Vue.use(Carousel)
Vue.use(CarouselItem)
Vue.use(FlatSurfaceShader)
Vue.use(headroom)
Vue.use(ScrollSpy)
Expand Down

0 comments on commit 532f447

Please sign in to comment.