Skip to content

Commit

Permalink
Add webpack server for development
Browse files Browse the repository at this point in the history
  • Loading branch information
TahaSh committed Jan 11, 2017
1 parent 371b41c commit b43d746
Show file tree
Hide file tree
Showing 10 changed files with 5,459 additions and 7 deletions.
3 changes: 3 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"presets": ["es2015"]
}
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
.DS_Store
node_modules/
node_modules/
npm-debug.log
2 changes: 1 addition & 1 deletion dist/vue-paginate.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* vue-paginate v3.3.0
* vue-paginate v3.3.1
* (c) 2017 Taha Shashtari
* @license MIT
*/
Expand Down
2 changes: 1 addition & 1 deletion dist/vue-paginate.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

83 changes: 83 additions & 0 deletions examples/App.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
<template>
<div id="app">
<h1>Vue-Paginate v3.0</h1>
<paginate name="items" :list="items" class="paginate-list">
<li v-for="item in paginated('items')">
{{ item }}
</li>
</paginate>
<paginate-links for="items"></paginate-links>
<paginate-links for="items" :limit="2"></paginate-links>
<paginate-links for="items" :simple="{
next: 'Next »',
prev: '« Back'
}"></paginate-links>
</div>
</template>

<script>
export default {
data () {
return {
items: ['Item One', 'Item Two', 'Item Three', 'Item Four', 'Item Five', 'Item Six', 'Item Seven', 'Item Eight', 'Item Nine', 'Item Ten', 'Item Eleven', 'Item Twelve', 'Item Thirteen'],
paginate: ['items']
}
}
}
</script>

<style lang="sass">
#app
font-family: 'Avenir', Helvetica, Arial, sans-serif
-webkit-font-smoothing: antialiased
-moz-osx-font-smoothing: grayscale
font-size: 20px
text-align: center
color: #2c3e50
margin-top: 60px
h1, h2
font-weight: normal
ul
list-style-type: none
padding: 0
li
display: inline-block
margin: 0 10px
.paginate-list
width: 159px
margin: 0 auto
text-align: left
li
display: block
&:before
content: ''
font-weight: bold
color: slategray
.paginate-links.items
user-select: none
a
cursor: pointer
li.active a
font-weight: bold
li.next:before
content: ' | '
margin-right: 13px
color: #ddd
li.disabled a
color: #ccc
cursor: no-drop
a
color: #42b983
</style>
11 changes: 11 additions & 0 deletions examples/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Vue-Paginate Example</title>
</head>
<body>
<div id="app"></div>
<script src="examples/__build__/app.js"></script>
</body>
</html>
10 changes: 10 additions & 0 deletions examples/main.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import Vue from 'vue'
import App from './App'
import VuePaginate from 'vue-paginate'

Vue.use(VuePaginate)

new Vue({
el: '#app',
render: h => h(App)
})
21 changes: 17 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
{
"name": "vue-paginate",
"version": "3.3.0",
"version": "3.3.1",
"description": "A simple vue.js plugin to paginate data",
"main": "dist/vue-paginate.js",
"scripts": {
"build": "rollup --environment NODE_ENV:production -c build/rollup.config.js && uglifyjs dist/vue-paginate.js -cm --comments -o dist/vue-paginate.min.js",
"test": "./node_modules/karma/bin/karma start"
"test": "./node_modules/karma/bin/karma start",
"dev": "./node_modules/webpack-dev-server/bin/webpack-dev-server.js --content-base examples --open --inline --hot"
},
"browserify": {
"transform": [
Expand Down Expand Up @@ -36,34 +37,46 @@
"vue": "^2.0.5"
},
"devDependencies": {
"babel-core": "^6.21.0",
"babel-loader": "^6.2.10",
"babel-plugin-espower": "^2.1.2",
"babel-preset-es2015": "^6.6.0",
"babel-preset-es2015": "^6.18.0",
"babel-preset-es2015-rollup": "^1.1.1",
"babelify": "^7.3.0",
"brfs": "^1.4.3",
"browserify": "^13.0.1",
"browserify-shim": "^3.8.12",
"chai": "^3.5.0",
"css-loader": "^0.26.1",
"file-loader": "^0.9.0",
"karma": "^0.13.22",
"karma-browserify": "^5.0.5",
"karma-chrome-launcher": "^1.0.1",
"karma-es6-shim": "^1.0.0",
"karma-mocha": "^1.0.1",
"karma-mocha-reporter": "^2.0.3",
"karma-phantomjs-launcher": "^1.0.0",
"karma-sinon-chai": "^1.2.4",
"karma-source-map-support": "^1.1.0",
"mocha": "^2.4.5",
"node-sass": "^4.2.0",
"phantomjs-prebuilt": "^2.1.7",
"rollup": "^0.31.2",
"rollup-plugin-babel": "^2.5.1",
"rollup-plugin-buble": "^0.14.0",
"rollup-plugin-commonjs": "^5.0.5",
"rollup-plugin-node-resolve": "^2.0.0",
"rollup-plugin-replace": "^1.1.1",
"sass-loader": "^4.1.1",
"sinon": "^1.17.6",
"sinon-chai": "^2.8.0",
"uglify-js": "^2.6.2",
"watchify": "^3.7.0"
"vue-loader": "^10.0.2",
"vue-style-loader": "^1.0.0",
"vue-template-compiler": "^2.1.8",
"watchify": "^3.7.0",
"webpack": "^1.14.0",
"webpack-dev-server": "^1.16.2"
},
"author": "Taha Shashtari",
"license": "MIT"
Expand Down
57 changes: 57 additions & 0 deletions webpack.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
const path = require('path')
const webpack = require('webpack')

module.exports = {

devtool: 'inline-source-map',

entry: path.join(__dirname, '/examples/main.js'),

output: {
path: path.join(__dirname, '/examples/__build__'),
filename: 'app.js',
publicPath: '/examples/__build__/'
},

module: {
loaders: [
{
test: /\.js$/,
exclude: /node_modules/,
loader: 'babel-loader'
},
{
test: /\.vue$/,
loader: 'vue',
}
]
},
vue: {
loaders: {
scss: 'vue-style-loader!css-loader!sass-loader', // <style lang="scss">
sass: 'vue-style-loader!css-loader!sass-loader?indentedSyntax' // <style lang="sass">
}
},

resolve: {
extensions: ['', '.js', '.vue'],
fallback: [path.join(__dirname, '../node_modules')],
alias: {
'vue': 'vue/dist/vue.common.js',
'vue-paginate': path.join(__dirname, 'src/index')
}
},

// Expose __dirname to allow automatically setting basename.
context: __dirname,
node: {
__dirname: true
},

plugins: [
new webpack.DefinePlugin({
'process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV || 'development')
})
]

}
Loading

0 comments on commit b43d746

Please sign in to comment.