From b43d74647705dd64e2345b916c3657767a416087 Mon Sep 17 00:00:00 2001 From: Taha Shashtari Date: Wed, 11 Jan 2017 23:12:47 +0200 Subject: [PATCH] Add webpack server for development --- .babelrc | 3 + .gitignore | 3 +- dist/vue-paginate.js | 2 +- dist/vue-paginate.min.js | 2 +- examples/App.vue | 83 + examples/index.html | 11 + examples/main.js | 10 + package.json | 21 +- webpack.config.js | 57 + yarn.lock | 5274 ++++++++++++++++++++++++++++++++++++++ 10 files changed, 5459 insertions(+), 7 deletions(-) create mode 100644 .babelrc create mode 100644 examples/App.vue create mode 100644 examples/index.html create mode 100644 examples/main.js create mode 100644 webpack.config.js create mode 100644 yarn.lock diff --git a/.babelrc b/.babelrc new file mode 100644 index 0000000..af0f0c3 --- /dev/null +++ b/.babelrc @@ -0,0 +1,3 @@ +{ + "presets": ["es2015"] +} \ No newline at end of file diff --git a/.gitignore b/.gitignore index 58b805f..41aa071 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ .DS_Store -node_modules/ \ No newline at end of file +node_modules/ +npm-debug.log \ No newline at end of file diff --git a/dist/vue-paginate.js b/dist/vue-paginate.js index 64172c1..48cb122 100644 --- a/dist/vue-paginate.js +++ b/dist/vue-paginate.js @@ -1,5 +1,5 @@ /** - * vue-paginate v3.3.0 + * vue-paginate v3.3.1 * (c) 2017 Taha Shashtari * @license MIT */ diff --git a/dist/vue-paginate.min.js b/dist/vue-paginate.min.js index 4a2b6b0..58db4d0 100644 --- a/dist/vue-paginate.min.js +++ b/dist/vue-paginate.min.js @@ -1,5 +1,5 @@ /** - * vue-paginate v3.3.0 + * vue-paginate v3.3.1 * (c) 2017 Taha Shashtari * @license MIT */ diff --git a/examples/App.vue b/examples/App.vue new file mode 100644 index 0000000..792f064 --- /dev/null +++ b/examples/App.vue @@ -0,0 +1,83 @@ + + + + + \ No newline at end of file diff --git a/examples/index.html b/examples/index.html new file mode 100644 index 0000000..2d8cb8a --- /dev/null +++ b/examples/index.html @@ -0,0 +1,11 @@ + + + + + Vue-Paginate Example + + +
+ + + \ No newline at end of file diff --git a/examples/main.js b/examples/main.js new file mode 100644 index 0000000..9bbae96 --- /dev/null +++ b/examples/main.js @@ -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) +}) \ No newline at end of file diff --git a/package.json b/package.json index e0e9de5..713cc0a 100644 --- a/package.json +++ b/package.json @@ -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": [ @@ -36,23 +37,29 @@ "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", @@ -60,10 +67,16 @@ "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" diff --git a/webpack.config.js b/webpack.config.js new file mode 100644 index 0000000..400ce64 --- /dev/null +++ b/webpack.config.js @@ -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', //