diff --git a/README.md b/README.md index 7a3008c..e98c1fa 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ -# vue-select [](https://travis-ci.org/sagalbot/vue-select) [](https://codeclimate.com/github/sagalbot/vue-select) [](https://codeclimate.com/github/sagalbot/vue-select) [](https://gemnasium.com/github.com/sagalbot/vue-select)   +# vue-select [](https://travis-ci.org/sagalbot/vue-select) [](https://codeclimate.com/github/sagalbot/vue-select) [](https://gemnasium.com/github.com/sagalbot/vue-select)   -> Rather than bringing in jQuery just to use Select2 or Chosen, this Vue.js component provides similar functionality without the extra overhead of jQuery, while providing the same awesome data-binding features you expect from Vue. Vue-select has no JavaScript dependencies other than Vue, and is designed to mimic [Select2](https://github.com/select2/select2). +> A native Vue.js component that provides similar functionality to Select2 without the overhead of jQuery. Vue-select has no JavaScript dependencies other than Vue, and is designed to mimic [Select2](https://github.com/select2/select2). #### Features diff --git a/build/build.js b/build/build.js index f666313..b8965b5 100644 --- a/build/build.js +++ b/build/build.js @@ -10,9 +10,9 @@ var ghpages = require('gh-pages') var webpackConfig = require('./webpack.prod.conf') console.log( - ' Tip:\n' + - ' Built files are meant to be served over an HTTP server.\n' + - ' Opening index.html over file:// won\'t work.\n' + ' Tip:\n' + + ' Built files are meant to be served over an HTTP server.\n' + + ' Opening index.html over file:// won\'t work.\n' ) var spinner = ora('building for production...') @@ -24,13 +24,23 @@ mkdir('-p', assetsPath) cp('-R', 'static/', assetsPath) webpack(webpackConfig, function (err, stats) { - spinner.stop() - if (err) throw err - process.stdout.write(stats.toString({ - colors: true, - modules: false, - children: false, - chunks: false, - chunkModules: false - }) + '\n') + spinner.stop() + if (err) throw err + process.stdout.write(stats.toString({ + colors: true, + modules: false, + children: false, + chunks: false, + chunkModules: false + }) + '\n') + + // $ npm run build publish + // This will publish /dist/ to the gh-pages + if (( process.argv.indexOf('publish') > 1 )) { + spinner = ora('Publishing to GitHub Pages...').start() + ghpages.publish(path.join(__dirname, '../dist'), function (err) { + spinner.stop() + if (err) throw err + }); + } }) diff --git a/config/index.js b/config/index.js index 9903ccc..0736cd0 100644 --- a/config/index.js +++ b/config/index.js @@ -7,7 +7,7 @@ module.exports = { index: path.resolve(__dirname, '../dist/index.html'), assetsRoot: path.resolve(__dirname, '../dist'), assetsSubDirectory: '', - assetsPublicPath: '/', + assetsPublicPath: ( process.argv.indexOf('publish') > 1 ) ? 'http://sagalbot.github.io/vue-select/' : '/', productionSourceMap: true }, dev: { diff --git a/index.html b/index.html index cfafd51..982074b 100644 --- a/index.html +++ b/index.html @@ -2,7 +2,7 @@
-