Skip to content

Commit

Permalink
v0.1.2
Browse files Browse the repository at this point in the history
  • Loading branch information
eteplus committed Mar 22, 2016
1 parent 91df7c9 commit 0fb2911
Show file tree
Hide file tree
Showing 50 changed files with 1,388 additions and 2,424 deletions.
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
src/assets/js/
17 changes: 17 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
## 更新记录
-------

#### v0.1.2 ( 2016-3-22 ) ####
- 更新依赖文件
- 修改部分component的命名
- 修改下拉刷新Directive
- 使用[ISlider](https://github.com/BE-FE/iSlider)替换sui的轮播插件
- 新增欢迎界面
- 新增自定义loader
- 新增无限滚动Directive
- 新增无限滚动加载更多示例
- 添加微信分享配置(根据实际情况配置)
- 添加[Iconfont](http://iconfont.cn/)自定义图标
- 按需加载组件

-------
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,3 +87,6 @@ npm run main
│ └── index.html // 项目入口文件
.
</pre>

### 更新记录
参看 [CHANGELOG.md](./CHANGELOG.md)
2 changes: 1 addition & 1 deletion build/dev-server.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ var favicon = require('express-favicon')

var app = express()
var compiler = webpack(config)
//设置资源目录
// 设置资源目录
app.use('/static', express.static(path.join(__dirname, '../src')))

app.use(favicon(path.join(__dirname, '../favicon.ico')))
Expand Down
14 changes: 9 additions & 5 deletions build/webpack.base.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,8 @@ module.exports = {
filename: '[name].js'
},
externals: {
// require("jquery") is external and available
// on the global var jQuery
'zepto': 'Zepto'
'zepto': 'Zepto',
'wx': 'jWeixin'
},
resolve: {
extensions: ['', '.js', '.vue', '.less'],
Expand All @@ -21,7 +20,7 @@ module.exports = {
}
},
resolveLoader: {
root: path.join(__dirname, 'node_modules'),
root: path.join(__dirname, 'node_modules')
},
module: {
loaders: [
Expand Down Expand Up @@ -49,13 +48,18 @@ module.exports = {
limit: 10000,
name: '[name].[ext]?[hash]'
}
},
{
test: /\.(eot|woff|ttf|svg)$/,
loader: 'url-loader?limit=30000&name=[name]-[hash].[ext]'
}
]
},
vue: {
loaders: {
js: 'babel!eslint',
less: 'vue-style!css!less'
less: 'vue-style!css!less',
sass: 'vue-style!css!sass'
}
},
eslint: {
Expand Down
30 changes: 27 additions & 3 deletions build/webpack.dev.conf.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
var webpack = require('webpack')
var config = require('./webpack.base.conf')
var HtmlWebpackPlugin = require('html-webpack-plugin')
var ExtractTextPlugin = require('extract-text-webpack-plugin')
var BrowserSyncPlugin = require('browser-sync-webpack-plugin')
config.devtool = 'eval-source-map'

config.output.filename = '[name].js'
config.output.chunkFilename = '[id].js'

var SOURCE_MAP = true

config.devtool = SOURCE_MAP ? 'eval-source-map' : false

// add hot-reload related code to entry chunk
config.entry.app = [
Expand All @@ -11,12 +18,29 @@ config.entry.app = [
config.entry.app
]

// generate loader string to be used with extract text plugin
function generateExtractLoaders (loaders) {
return loaders.map(function (loader) {
return loader + '-loader' + (SOURCE_MAP ? '?sourceMap' : '')
}).join('!')
}

config.vue.loaders = {
js: 'babel!eslint',
// http://vuejs.github.io/vue-loader/configurations/extract-css.html
css: ExtractTextPlugin.extract('vue-style-loader', generateExtractLoaders(['css'])),
less: ExtractTextPlugin.extract('vue-style-loader', generateExtractLoaders(['css', 'less'])),
sass: ExtractTextPlugin.extract('vue-style-loader', generateExtractLoaders(['css', 'sass'])),
stylus: ExtractTextPlugin.extract('vue-style-loader', generateExtractLoaders(['css', 'stylus']))
}

config.output.publicPath = '/'

config.plugins = (config.plugins || []).concat([
new webpack.optimize.OccurenceOrderPlugin(),
new webpack.HotModuleReplacementPlugin(),
new webpack.NoErrorsPlugin(),
new ExtractTextPlugin('[name].css'),
new HtmlWebpackPlugin({
filename: 'index.html',
template: 'src/index.html'
Expand All @@ -30,10 +54,10 @@ config.plugins = (config.plugins || []).concat([
logConnections: false,
notify: false
},
// plugin options
{
reload: true
})
}
)
])

module.exports = config
9 changes: 6 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"name": "vue-sui-demo",
"description": "vue combine with sui-mobile",
"author": "eteplus <[email protected]>",
"version": "0.1.2",
"scripts": {
"main": "node index.js",
"dev": "node build/dev-server.js",
Expand All @@ -12,19 +13,19 @@
"url": "https://github.com/eteplus/vue-sui-demo.git"
},
"dependencies": {
"vue": "^1.0.15",
"vue": "^1.0.18",
"vue-resource": "^0.6.1",
"vue-router": "^0.7.9"
"vue-router": "^0.7.11"
},
"devDependencies": {
"browser-sync-webpack-plugin": "^1.0.1",
"babel-core": "^6.0.0",
"babel-loader": "^6.0.0",
"babel-plugin-transform-runtime": "^6.0.0",
"babel-preset-es2015": "^6.0.0",
"babel-preset-stage-2": "^6.0.0",
"babel-runtime": "^5.8.0",
"browser-sync": "^2.11.1",
"browser-sync-webpack-plugin": "^1.0.1",
"classnames": "^2.2.3",
"connect-history-api-fallback": "^1.1.0",
"css-loader": "^0.23.0",
Expand All @@ -43,7 +44,9 @@
"json-loader": "^0.5.4",
"less": "^2.6.0",
"less-loader": "^2.2.2",
"node-sass": "^3.4.2",
"rimraf": "^2.5.0",
"sass-loader": "^3.2.0",
"url-loader": "^0.5.7",
"vue-hot-reload-api": "^1.2.0",
"vue-html-loader": "^1.0.0",
Expand Down
4 changes: 3 additions & 1 deletion src/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import VueRouter from 'vue-router'
import VueResource from 'vue-resource'
import routerConfig from './router'
import pullToRefresh from './directives/pullToRefresh'
import infiniteScroll from './directives/infiniteScroll'
import * as filters from './filters'
import app from './main'

Expand All @@ -11,7 +12,7 @@ Vue.use(VueRouter)

const router = new VueRouter({
hashbang: true,
history: false,
history: true,
saveScrollPosition: true,
suppressTransitionError: true
})
Expand All @@ -26,6 +27,7 @@ Vue.http.options.emulateJSON = true

// Directive
Vue.directive('pullToRefresh', pullToRefresh)
Vue.directive('infiniteScroll', infiniteScroll)

// Filters
Vue.filter('date', filters.dateFilter)
Expand Down
Loading

0 comments on commit 0fb2911

Please sign in to comment.