├── .babelrc ├── .gitignore ├── README.md ├── assets ├── js │ ├── app.js │ └── components │ │ └── welcome.vue └── scss │ ├── app.scss │ └── vendor.scss ├── footer.php ├── functions.php ├── header.php ├── index.php ├── package.json ├── postcss.config.js ├── public ├── css │ ├── app.css │ └── vendor.css └── js │ ├── app.js │ └── vendor.js ├── style.css └── webpack.config.js /.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": [ 3 | ["env"] 4 | ] 5 | } -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | **.DS_Store* -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # WordPress starter theme with Vue.js integrated. 2 | This theme pretty much includes only a way to compile your assets with Vue code. 3 | It's meant for you to learn Vue inside WordPress, or to create your own theme. 4 | It includes an example component. 5 | I'm using Webpack to compile the assets. I added webpack-dev-server and HMR to avoid page reload on asset change. 6 | I also added browserSync for auto reloading on PHP file change. 7 | 8 | There are packages you would probably want to use such as axios, vuex, etc. I would leave them to you to install. 9 | 10 | Clone the theme, run ```npm install``` and start playing. 11 | 12 | Make sure to modify the BrowserSync proxy link inside the webpack.config.js. 13 | 14 | ## Note 15 | webpack-dev-server serves assets from memory, which means that on development mode we would have to include asset files from 16 | ``` http://localhost:8080/[name].css ``` and ``` http://localhost:8080/[name].js ```. 17 | When you switch to production you remove these links and remove the comment tags from the asset links to the current directory. 18 | I added comments in the functions.php file to make it more clear. 19 | 20 | Keep in mind that you need to run ``` npm run dev ```, otherwise you would get 404 on the development asset links. 21 | 22 | ## Commands 23 | 1. ``` npm run build ``` Will compile and minify assets for produciton. 24 | 2. ``` npm run build:dev ``` Will compile assets. 25 | 3. ``` npm run dev ``` Will compile and start webpck-dev-server and browserSync. 26 | 27 | ## Vue devtools 28 | Download it [here](https://github.com/vuejs/vue-devtools#vue-devtools) 29 | -------------------------------------------------------------------------------- /assets/js/app.js: -------------------------------------------------------------------------------- 1 | import '../scss/app.scss'; 2 | 3 | import Vue from 'vue'; 4 | import welcome from './components/welcome.vue'; 5 | 6 | window.Vue = Vue; 7 | 8 | Vue.component('welcome', welcome); 9 | 10 | const app = new Vue({ 11 | el: '#app', 12 | }); 13 | 14 | -------------------------------------------------------------------------------- /assets/js/components/welcome.vue: -------------------------------------------------------------------------------- 1 | 4 | 5 | 12 | 13 | -------------------------------------------------------------------------------- /assets/scss/app.scss: -------------------------------------------------------------------------------- 1 | #app { 2 | h1 { 3 | font-size: 60px; 4 | text-align: center; 5 | background: -webkit-linear-gradient(#41B883, #35495E, #1D74B0); 6 | -webkit-background-clip: text; 7 | -webkit-text-fill-color: transparent; 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /assets/scss/vendor.scss: -------------------------------------------------------------------------------- 1 | //For your css libraries, such as bulma, bootstrap, foundation, erc. -------------------------------------------------------------------------------- /footer.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /functions.php: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | 8 | WordVue 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /index.php: -------------------------------------------------------------------------------- 1 | 2 |
3 | 4 |
5 | 6 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "wordvuepack", 3 | "version": "1.0.0", 4 | "description": "WordPress theme with Vue.js integrated", 5 | "main": "index.js", 6 | "scripts": { 7 | "build": "webpack --env.prod -p", 8 | "build:dev": "webpack --env.dev", 9 | "dev": "webpack-dev-server --env.dev --env.server --env.browserSync" 10 | }, 11 | "author": "Isaac Ben", 12 | "license": "ISC", 13 | "devDependencies": { 14 | "autoprefixer": "^7.1.4", 15 | "babel-core": "^6.26.0", 16 | "babel-loader": "^7.1.2", 17 | "babel-preset-env": "^1.6.0", 18 | "browser-sync": "^2.18.13", 19 | "css-hot-loader": "^1.3.2", 20 | "css-loader": "^0.28.7", 21 | "extract-text-webpack-plugin": "^3.0.1", 22 | "node-sass": "^4.5.3", 23 | "postcss-loader": "^2.0.8", 24 | "progress-bar-webpack-plugin": "^1.10.0", 25 | "sass-loader": "^6.0.6", 26 | "style-loader": "^0.19.0", 27 | "uglifyjs-webpack-plugin": "^1.0.0-beta.3", 28 | "vue": "^2.4.4", 29 | "vue-loader": "^13.0.4", 30 | "vue-template-compiler": "^2.4.4", 31 | "webpack": "^3.6.0", 32 | "webpack-dev-server": "^2.9.3" 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /postcss.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | plugins: [ 3 | require('autoprefixer') 4 | ] 5 | }; -------------------------------------------------------------------------------- /public/css/app.css: -------------------------------------------------------------------------------- 1 | #app h1 { 2 | font-size: 60px; 3 | text-align: center; 4 | background: -webkit-linear-gradient(#41B883, #35495E, #1D74B0); 5 | -webkit-background-clip: text; 6 | -webkit-text-fill-color: transparent; } 7 | -------------------------------------------------------------------------------- /public/css/vendor.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itzikbenh/WordVuePack/db0d7d5c05e8fd98b3579cd30fd414d31f34330f/public/css/vendor.css -------------------------------------------------------------------------------- /public/js/app.js: -------------------------------------------------------------------------------- 1 | webpackJsonp([0],{ 2 | 3 | /***/ "./assets/js/app.js": 4 | /***/ (function(module, exports, __webpack_require__) { 5 | 6 | "use strict"; 7 | 8 | 9 | __webpack_require__("./assets/scss/app.scss"); 10 | 11 | var _vue = __webpack_require__("./node_modules/vue/dist/vue.esm.js"); 12 | 13 | var _vue2 = _interopRequireDefault(_vue); 14 | 15 | var _welcome = __webpack_require__("./assets/js/components/welcome.vue"); 16 | 17 | var _welcome2 = _interopRequireDefault(_welcome); 18 | 19 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } 20 | 21 | window.Vue = _vue2.default; 22 | 23 | _vue2.default.component('welcome', _welcome2.default); 24 | 25 | var app = new _vue2.default({ 26 | el: '#app' 27 | }); 28 | 29 | /***/ }), 30 | 31 | /***/ "./assets/js/components/welcome.vue": 32 | /***/ (function(module, __webpack_exports__, __webpack_require__) { 33 | 34 | "use strict"; 35 | Object.defineProperty(__webpack_exports__, "__esModule", { value: true }); 36 | /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_bustCache_welcome_vue__ = __webpack_require__("./node_modules/babel-loader/lib/index.js!./node_modules/vue-loader/lib/selector.js?type=script&index=0&bustCache!./assets/js/components/welcome.vue"); 37 | /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_bustCache_welcome_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_bustCache_welcome_vue__); 38 | /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__node_modules_vue_loader_lib_template_compiler_index_id_data_v_184d830b_hasScoped_false_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_bustCache_welcome_vue__ = __webpack_require__("./node_modules/vue-loader/lib/template-compiler/index.js?{\"id\":\"data-v-184d830b\",\"hasScoped\":false,\"buble\":{\"transforms\":{}}}!./node_modules/vue-loader/lib/selector.js?type=template&index=0&bustCache!./assets/js/components/welcome.vue"); 39 | var disposed = false 40 | var normalizeComponent = __webpack_require__("./node_modules/vue-loader/lib/component-normalizer.js") 41 | /* script */ 42 | 43 | /* template */ 44 | 45 | /* template functional */ 46 | var __vue_template_functional__ = false 47 | /* styles */ 48 | var __vue_styles__ = null 49 | /* scopeId */ 50 | var __vue_scopeId__ = null 51 | /* moduleIdentifier (server only) */ 52 | var __vue_module_identifier__ = null 53 | var Component = normalizeComponent( 54 | __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_bustCache_welcome_vue___default.a, 55 | __WEBPACK_IMPORTED_MODULE_1__node_modules_vue_loader_lib_template_compiler_index_id_data_v_184d830b_hasScoped_false_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_bustCache_welcome_vue__["a" /* default */], 56 | __vue_template_functional__, 57 | __vue_styles__, 58 | __vue_scopeId__, 59 | __vue_module_identifier__ 60 | ) 61 | Component.options.__file = "assets/js/components/welcome.vue" 62 | if (Component.esModule && Object.keys(Component.esModule).some(function (key) { return key !== "default" && key.substr(0, 2) !== "__"})) { console.error("named exports are not supported in *.vue files.")} 63 | 64 | /* hot reload */ 65 | if (true) {(function () { 66 | var hotAPI = __webpack_require__("./node_modules/vue-hot-reload-api/dist/index.js") 67 | hotAPI.install(__webpack_require__("./node_modules/vue/dist/vue.esm.js"), false) 68 | if (!hotAPI.compatible) return 69 | module.hot.accept() 70 | if (!module.hot.data) { 71 | hotAPI.createRecord("data-v-184d830b", Component.options) 72 | } else { 73 | hotAPI.reload("data-v-184d830b", Component.options) 74 | ' + ' } 75 | module.hot.dispose(function (data) { 76 | disposed = true 77 | }) 78 | })()} 79 | 80 | /* harmony default export */ __webpack_exports__["default"] = (Component.exports); 81 | 82 | 83 | /***/ }), 84 | 85 | /***/ "./assets/scss/app.scss": 86 | /***/ (function(module, exports, __webpack_require__) { 87 | 88 | // removed by extract-text-webpack-plugin 89 | if(true) { 90 | // 1508633528155 91 | var cssReload = __webpack_require__("./node_modules/css-hot-loader/hotModuleReplacement.js")(module.i, {"fileMap":"{fileName}"}); 92 | module.hot.dispose(cssReload); 93 | module.hot.accept(undefined, cssReload); 94 | } 95 | 96 | 97 | /***/ }), 98 | 99 | /***/ "./node_modules/babel-loader/lib/index.js!./node_modules/vue-loader/lib/selector.js?type=script&index=0&bustCache!./assets/js/components/welcome.vue": 100 | /***/ (function(module, exports, __webpack_require__) { 101 | 102 | "use strict"; 103 | 104 | 105 | Object.defineProperty(exports, "__esModule", { 106 | value: true 107 | }); 108 | // 109 | // 110 | // 111 | // 112 | 113 | exports.default = { 114 | mounted: function mounted() { 115 | console.log('Component mounted.'); 116 | } 117 | }; 118 | 119 | /***/ }), 120 | 121 | /***/ "./node_modules/css-hot-loader/hotModuleReplacement.js": 122 | /***/ (function(module, exports, __webpack_require__) { 123 | 124 | var normalizeUrl = __webpack_require__("./node_modules/normalize-url/index.js"); 125 | var srcByModuleId = Object.create(null); 126 | 127 | var getCurrentScriptUrl = function(moduleId) { 128 | var src = srcByModuleId[moduleId]; 129 | if (!src && document) { 130 | if (document.currentScript) { 131 | src = document.currentScript.src; 132 | } else { 133 | var scripts = document.getElementsByTagName('script'); 134 | src = scripts[scripts.length - 1].src; 135 | } 136 | srcByModuleId[moduleId] = src; 137 | } 138 | 139 | return function(fileMap) { 140 | var splitResult = /([^\\/]+)\.js$/.exec(src); 141 | var filename = splitResult && splitResult[1]; 142 | if (!filename) { 143 | return [src.replace('.js', '.css')]; 144 | } 145 | return fileMap.split(',').map(function(mapRule) { 146 | var reg = new RegExp(filename + '\\.js$', 'g') 147 | return normalizeUrl(src.replace(reg, mapRule.replace(/{fileName}/g, filename) + '.css'), { stripWWW: false }); 148 | }); 149 | }; 150 | } 151 | 152 | function updateCss(el, url) { 153 | if (!url) { 154 | url = el.href.split('?')[0]; 155 | } 156 | 157 | if (!url || !(url.indexOf('.css') > -1)) return; 158 | 159 | var newEl = el.cloneNode(); 160 | newEl.addEventListener('load', function () { 161 | el.remove(); 162 | }); 163 | newEl.addEventListener('error', function () { 164 | el.remove(); 165 | }); 166 | newEl.href = url + '?' + Date.now(); 167 | el.parentNode.insertBefore(newEl, el.nextSibling); 168 | } 169 | 170 | function reloadStyle(src) { 171 | var elements = document.querySelectorAll('link'); 172 | var loaded = false; 173 | [].slice.call(elements).forEach(function(el) { 174 | var url = getReloadUrl(el.href, src); 175 | if (url) { 176 | updateCss(el, url); 177 | loaded = true; 178 | } 179 | }); 180 | return loaded; 181 | } 182 | 183 | function getReloadUrl(href, src) { 184 | href = normalizeUrl(href, { stripWWW: false }); 185 | var ret; 186 | src.some(function(url) { 187 | if (href.indexOf(src) > -1) { 188 | ret = url; 189 | } 190 | }); 191 | return ret; 192 | } 193 | 194 | function reloadAll() { 195 | var elements = document.querySelectorAll('link'); 196 | [].slice.call(elements).forEach(function(el) { 197 | updateCss(el); 198 | }); 199 | } 200 | 201 | module.exports = function(moduleId, options) { 202 | var getScriptSrc = getCurrentScriptUrl(moduleId); 203 | return function() { 204 | if (typeof document === 'undefined') { 205 | return; 206 | } 207 | 208 | var src = getScriptSrc(options.fileMap); 209 | var reloaded = reloadStyle(src); 210 | if (reloaded) { 211 | console.log('[HMR] css reload %s', src.join(' ')); 212 | } else { 213 | console.log('[HMR] Reload all css'); 214 | reloadAll(); 215 | } 216 | } 217 | }; 218 | 219 | 220 | /***/ }), 221 | 222 | /***/ "./node_modules/is-plain-obj/index.js": 223 | /***/ (function(module, exports, __webpack_require__) { 224 | 225 | "use strict"; 226 | 227 | var toString = Object.prototype.toString; 228 | 229 | module.exports = function (x) { 230 | var prototype; 231 | return toString.call(x) === '[object Object]' && (prototype = Object.getPrototypeOf(x), prototype === null || prototype === Object.getPrototypeOf({})); 232 | }; 233 | 234 | 235 | /***/ }), 236 | 237 | /***/ "./node_modules/normalize-url/index.js": 238 | /***/ (function(module, exports, __webpack_require__) { 239 | 240 | "use strict"; 241 | 242 | var url = __webpack_require__("./node_modules/url/url.js"); 243 | var punycode = __webpack_require__("./node_modules/punycode/punycode.js"); 244 | var queryString = __webpack_require__("./node_modules/query-string/index.js"); 245 | var prependHttp = __webpack_require__("./node_modules/prepend-http/index.js"); 246 | var sortKeys = __webpack_require__("./node_modules/sort-keys/index.js"); 247 | var objectAssign = __webpack_require__("./node_modules/object-assign/index.js"); 248 | 249 | var DEFAULT_PORTS = { 250 | 'http:': 80, 251 | 'https:': 443, 252 | 'ftp:': 21 253 | }; 254 | 255 | // protocols that always contain a `//`` bit 256 | var slashedProtocol = { 257 | 'http': true, 258 | 'https': true, 259 | 'ftp': true, 260 | 'gopher': true, 261 | 'file': true, 262 | 'http:': true, 263 | 'https:': true, 264 | 'ftp:': true, 265 | 'gopher:': true, 266 | 'file:': true 267 | }; 268 | 269 | function testParameter(name, filters) { 270 | return filters.some(function (filter) { 271 | return filter instanceof RegExp ? filter.test(name) : filter === name; 272 | }); 273 | } 274 | 275 | module.exports = function (str, opts) { 276 | opts = objectAssign({ 277 | normalizeProtocol: true, 278 | normalizeHttps: false, 279 | stripFragment: true, 280 | stripWWW: true, 281 | removeQueryParameters: [/^utm_\w+/i], 282 | removeTrailingSlash: true, 283 | removeDirectoryIndex: false 284 | }, opts); 285 | 286 | if (typeof str !== 'string') { 287 | throw new TypeError('Expected a string'); 288 | } 289 | 290 | var hasRelativeProtocol = str.indexOf('//') === 0; 291 | 292 | // prepend protocol 293 | str = prependHttp(str.trim()).replace(/^\/\//, 'http://'); 294 | 295 | var urlObj = url.parse(str); 296 | 297 | if (opts.normalizeHttps && urlObj.protocol === 'https:') { 298 | urlObj.protocol = 'http:'; 299 | } 300 | 301 | if (!urlObj.hostname && !urlObj.pathname) { 302 | throw new Error('Invalid URL'); 303 | } 304 | 305 | // prevent these from being used by `url.format` 306 | delete urlObj.host; 307 | delete urlObj.query; 308 | 309 | // remove fragment 310 | if (opts.stripFragment) { 311 | delete urlObj.hash; 312 | } 313 | 314 | // remove default port 315 | var port = DEFAULT_PORTS[urlObj.protocol]; 316 | if (Number(urlObj.port) === port) { 317 | delete urlObj.port; 318 | } 319 | 320 | // remove duplicate slashes 321 | if (urlObj.pathname) { 322 | urlObj.pathname = urlObj.pathname.replace(/\/{2,}/g, '/'); 323 | } 324 | 325 | // decode URI octets 326 | if (urlObj.pathname) { 327 | urlObj.pathname = decodeURI(urlObj.pathname); 328 | } 329 | 330 | // remove directory index 331 | if (opts.removeDirectoryIndex === true) { 332 | opts.removeDirectoryIndex = [/^index\.[a-z]+$/]; 333 | } 334 | 335 | if (Array.isArray(opts.removeDirectoryIndex) && opts.removeDirectoryIndex.length) { 336 | var pathComponents = urlObj.pathname.split('/'); 337 | var lastComponent = pathComponents[pathComponents.length - 1]; 338 | 339 | if (testParameter(lastComponent, opts.removeDirectoryIndex)) { 340 | pathComponents = pathComponents.slice(0, pathComponents.length - 1); 341 | urlObj.pathname = pathComponents.slice(1).join('/') + '/'; 342 | } 343 | } 344 | 345 | // resolve relative paths, but only for slashed protocols 346 | if (slashedProtocol[urlObj.protocol]) { 347 | var domain = urlObj.protocol + '//' + urlObj.hostname; 348 | var relative = url.resolve(domain, urlObj.pathname); 349 | urlObj.pathname = relative.replace(domain, ''); 350 | } 351 | 352 | if (urlObj.hostname) { 353 | // IDN to Unicode 354 | urlObj.hostname = punycode.toUnicode(urlObj.hostname).toLowerCase(); 355 | 356 | // remove trailing dot 357 | urlObj.hostname = urlObj.hostname.replace(/\.$/, ''); 358 | 359 | // remove `www.` 360 | if (opts.stripWWW) { 361 | urlObj.hostname = urlObj.hostname.replace(/^www\./, ''); 362 | } 363 | } 364 | 365 | // remove URL with empty query string 366 | if (urlObj.search === '?') { 367 | delete urlObj.search; 368 | } 369 | 370 | var queryParameters = queryString.parse(urlObj.search); 371 | 372 | // remove query unwanted parameters 373 | if (Array.isArray(opts.removeQueryParameters)) { 374 | for (var key in queryParameters) { 375 | if (testParameter(key, opts.removeQueryParameters)) { 376 | delete queryParameters[key]; 377 | } 378 | } 379 | } 380 | 381 | // sort query parameters 382 | urlObj.search = queryString.stringify(sortKeys(queryParameters)); 383 | 384 | // decode query parameters 385 | urlObj.search = decodeURIComponent(urlObj.search); 386 | 387 | // take advantage of many of the Node `url` normalizations 388 | str = url.format(urlObj); 389 | 390 | // remove ending `/` 391 | if (opts.removeTrailingSlash || urlObj.pathname === '/') { 392 | str = str.replace(/\/$/, ''); 393 | } 394 | 395 | // restore relative protocol, if applicable 396 | if (hasRelativeProtocol && !opts.normalizeProtocol) { 397 | str = str.replace(/^http:\/\//, '//'); 398 | } 399 | 400 | return str; 401 | }; 402 | 403 | 404 | /***/ }), 405 | 406 | /***/ "./node_modules/object-assign/index.js": 407 | /***/ (function(module, exports, __webpack_require__) { 408 | 409 | "use strict"; 410 | /* 411 | object-assign 412 | (c) Sindre Sorhus 413 | @license MIT 414 | */ 415 | 416 | 417 | /* eslint-disable no-unused-vars */ 418 | var getOwnPropertySymbols = Object.getOwnPropertySymbols; 419 | var hasOwnProperty = Object.prototype.hasOwnProperty; 420 | var propIsEnumerable = Object.prototype.propertyIsEnumerable; 421 | 422 | function toObject(val) { 423 | if (val === null || val === undefined) { 424 | throw new TypeError('Object.assign cannot be called with null or undefined'); 425 | } 426 | 427 | return Object(val); 428 | } 429 | 430 | function shouldUseNative() { 431 | try { 432 | if (!Object.assign) { 433 | return false; 434 | } 435 | 436 | // Detect buggy property enumeration order in older V8 versions. 437 | 438 | // https://bugs.chromium.org/p/v8/issues/detail?id=4118 439 | var test1 = new String('abc'); // eslint-disable-line no-new-wrappers 440 | test1[5] = 'de'; 441 | if (Object.getOwnPropertyNames(test1)[0] === '5') { 442 | return false; 443 | } 444 | 445 | // https://bugs.chromium.org/p/v8/issues/detail?id=3056 446 | var test2 = {}; 447 | for (var i = 0; i < 10; i++) { 448 | test2['_' + String.fromCharCode(i)] = i; 449 | } 450 | var order2 = Object.getOwnPropertyNames(test2).map(function (n) { 451 | return test2[n]; 452 | }); 453 | if (order2.join('') !== '0123456789') { 454 | return false; 455 | } 456 | 457 | // https://bugs.chromium.org/p/v8/issues/detail?id=3056 458 | var test3 = {}; 459 | 'abcdefghijklmnopqrst'.split('').forEach(function (letter) { 460 | test3[letter] = letter; 461 | }); 462 | if (Object.keys(Object.assign({}, test3)).join('') !== 463 | 'abcdefghijklmnopqrst') { 464 | return false; 465 | } 466 | 467 | return true; 468 | } catch (err) { 469 | // We don't expect any of the above to throw, but better to be safe. 470 | return false; 471 | } 472 | } 473 | 474 | module.exports = shouldUseNative() ? Object.assign : function (target, source) { 475 | var from; 476 | var to = toObject(target); 477 | var symbols; 478 | 479 | for (var s = 1; s < arguments.length; s++) { 480 | from = Object(arguments[s]); 481 | 482 | for (var key in from) { 483 | if (hasOwnProperty.call(from, key)) { 484 | to[key] = from[key]; 485 | } 486 | } 487 | 488 | if (getOwnPropertySymbols) { 489 | symbols = getOwnPropertySymbols(from); 490 | for (var i = 0; i < symbols.length; i++) { 491 | if (propIsEnumerable.call(from, symbols[i])) { 492 | to[symbols[i]] = from[symbols[i]]; 493 | } 494 | } 495 | } 496 | } 497 | 498 | return to; 499 | }; 500 | 501 | 502 | /***/ }), 503 | 504 | /***/ "./node_modules/prepend-http/index.js": 505 | /***/ (function(module, exports, __webpack_require__) { 506 | 507 | "use strict"; 508 | 509 | module.exports = function (url) { 510 | if (typeof url !== 'string') { 511 | throw new TypeError('Expected a string, got ' + typeof url); 512 | } 513 | 514 | url = url.trim(); 515 | 516 | if (/^\.*\/|^(?!localhost)\w+:/.test(url)) { 517 | return url; 518 | } 519 | 520 | return url.replace(/^(?!(?:\w+:)?\/\/)/, 'http://'); 521 | }; 522 | 523 | 524 | /***/ }), 525 | 526 | /***/ "./node_modules/punycode/punycode.js": 527 | /***/ (function(module, exports, __webpack_require__) { 528 | 529 | /* WEBPACK VAR INJECTION */(function(module, global) {var __WEBPACK_AMD_DEFINE_RESULT__;/*! https://mths.be/punycode v1.4.1 by @mathias */ 530 | ;(function(root) { 531 | 532 | /** Detect free variables */ 533 | var freeExports = typeof exports == 'object' && exports && 534 | !exports.nodeType && exports; 535 | var freeModule = typeof module == 'object' && module && 536 | !module.nodeType && module; 537 | var freeGlobal = typeof global == 'object' && global; 538 | if ( 539 | freeGlobal.global === freeGlobal || 540 | freeGlobal.window === freeGlobal || 541 | freeGlobal.self === freeGlobal 542 | ) { 543 | root = freeGlobal; 544 | } 545 | 546 | /** 547 | * The `punycode` object. 548 | * @name punycode 549 | * @type Object 550 | */ 551 | var punycode, 552 | 553 | /** Highest positive signed 32-bit float value */ 554 | maxInt = 2147483647, // aka. 0x7FFFFFFF or 2^31-1 555 | 556 | /** Bootstring parameters */ 557 | base = 36, 558 | tMin = 1, 559 | tMax = 26, 560 | skew = 38, 561 | damp = 700, 562 | initialBias = 72, 563 | initialN = 128, // 0x80 564 | delimiter = '-', // '\x2D' 565 | 566 | /** Regular expressions */ 567 | regexPunycode = /^xn--/, 568 | regexNonASCII = /[^\x20-\x7E]/, // unprintable ASCII chars + non-ASCII chars 569 | regexSeparators = /[\x2E\u3002\uFF0E\uFF61]/g, // RFC 3490 separators 570 | 571 | /** Error messages */ 572 | errors = { 573 | 'overflow': 'Overflow: input needs wider integers to process', 574 | 'not-basic': 'Illegal input >= 0x80 (not a basic code point)', 575 | 'invalid-input': 'Invalid input' 576 | }, 577 | 578 | /** Convenience shortcuts */ 579 | baseMinusTMin = base - tMin, 580 | floor = Math.floor, 581 | stringFromCharCode = String.fromCharCode, 582 | 583 | /** Temporary variable */ 584 | key; 585 | 586 | /*--------------------------------------------------------------------------*/ 587 | 588 | /** 589 | * A generic error utility function. 590 | * @private 591 | * @param {String} type The error type. 592 | * @returns {Error} Throws a `RangeError` with the applicable error message. 593 | */ 594 | function error(type) { 595 | throw new RangeError(errors[type]); 596 | } 597 | 598 | /** 599 | * A generic `Array#map` utility function. 600 | * @private 601 | * @param {Array} array The array to iterate over. 602 | * @param {Function} callback The function that gets called for every array 603 | * item. 604 | * @returns {Array} A new array of values returned by the callback function. 605 | */ 606 | function map(array, fn) { 607 | var length = array.length; 608 | var result = []; 609 | while (length--) { 610 | result[length] = fn(array[length]); 611 | } 612 | return result; 613 | } 614 | 615 | /** 616 | * A simple `Array#map`-like wrapper to work with domain name strings or email 617 | * addresses. 618 | * @private 619 | * @param {String} domain The domain name or email address. 620 | * @param {Function} callback The function that gets called for every 621 | * character. 622 | * @returns {Array} A new string of characters returned by the callback 623 | * function. 624 | */ 625 | function mapDomain(string, fn) { 626 | var parts = string.split('@'); 627 | var result = ''; 628 | if (parts.length > 1) { 629 | // In email addresses, only the domain name should be punycoded. Leave 630 | // the local part (i.e. everything up to `@`) intact. 631 | result = parts[0] + '@'; 632 | string = parts[1]; 633 | } 634 | // Avoid `split(regex)` for IE8 compatibility. See #17. 635 | string = string.replace(regexSeparators, '\x2E'); 636 | var labels = string.split('.'); 637 | var encoded = map(labels, fn).join('.'); 638 | return result + encoded; 639 | } 640 | 641 | /** 642 | * Creates an array containing the numeric code points of each Unicode 643 | * character in the string. While JavaScript uses UCS-2 internally, 644 | * this function will convert a pair of surrogate halves (each of which 645 | * UCS-2 exposes as separate characters) into a single code point, 646 | * matching UTF-16. 647 | * @see `punycode.ucs2.encode` 648 | * @see 649 | * @memberOf punycode.ucs2 650 | * @name decode 651 | * @param {String} string The Unicode input string (UCS-2). 652 | * @returns {Array} The new array of code points. 653 | */ 654 | function ucs2decode(string) { 655 | var output = [], 656 | counter = 0, 657 | length = string.length, 658 | value, 659 | extra; 660 | while (counter < length) { 661 | value = string.charCodeAt(counter++); 662 | if (value >= 0xD800 && value <= 0xDBFF && counter < length) { 663 | // high surrogate, and there is a next character 664 | extra = string.charCodeAt(counter++); 665 | if ((extra & 0xFC00) == 0xDC00) { // low surrogate 666 | output.push(((value & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000); 667 | } else { 668 | // unmatched surrogate; only append this code unit, in case the next 669 | // code unit is the high surrogate of a surrogate pair 670 | output.push(value); 671 | counter--; 672 | } 673 | } else { 674 | output.push(value); 675 | } 676 | } 677 | return output; 678 | } 679 | 680 | /** 681 | * Creates a string based on an array of numeric code points. 682 | * @see `punycode.ucs2.decode` 683 | * @memberOf punycode.ucs2 684 | * @name encode 685 | * @param {Array} codePoints The array of numeric code points. 686 | * @returns {String} The new Unicode string (UCS-2). 687 | */ 688 | function ucs2encode(array) { 689 | return map(array, function(value) { 690 | var output = ''; 691 | if (value > 0xFFFF) { 692 | value -= 0x10000; 693 | output += stringFromCharCode(value >>> 10 & 0x3FF | 0xD800); 694 | value = 0xDC00 | value & 0x3FF; 695 | } 696 | output += stringFromCharCode(value); 697 | return output; 698 | }).join(''); 699 | } 700 | 701 | /** 702 | * Converts a basic code point into a digit/integer. 703 | * @see `digitToBasic()` 704 | * @private 705 | * @param {Number} codePoint The basic numeric code point value. 706 | * @returns {Number} The numeric value of a basic code point (for use in 707 | * representing integers) in the range `0` to `base - 1`, or `base` if 708 | * the code point does not represent a value. 709 | */ 710 | function basicToDigit(codePoint) { 711 | if (codePoint - 48 < 10) { 712 | return codePoint - 22; 713 | } 714 | if (codePoint - 65 < 26) { 715 | return codePoint - 65; 716 | } 717 | if (codePoint - 97 < 26) { 718 | return codePoint - 97; 719 | } 720 | return base; 721 | } 722 | 723 | /** 724 | * Converts a digit/integer into a basic code point. 725 | * @see `basicToDigit()` 726 | * @private 727 | * @param {Number} digit The numeric value of a basic code point. 728 | * @returns {Number} The basic code point whose value (when used for 729 | * representing integers) is `digit`, which needs to be in the range 730 | * `0` to `base - 1`. If `flag` is non-zero, the uppercase form is 731 | * used; else, the lowercase form is used. The behavior is undefined 732 | * if `flag` is non-zero and `digit` has no uppercase form. 733 | */ 734 | function digitToBasic(digit, flag) { 735 | // 0..25 map to ASCII a..z or A..Z 736 | // 26..35 map to ASCII 0..9 737 | return digit + 22 + 75 * (digit < 26) - ((flag != 0) << 5); 738 | } 739 | 740 | /** 741 | * Bias adaptation function as per section 3.4 of RFC 3492. 742 | * https://tools.ietf.org/html/rfc3492#section-3.4 743 | * @private 744 | */ 745 | function adapt(delta, numPoints, firstTime) { 746 | var k = 0; 747 | delta = firstTime ? floor(delta / damp) : delta >> 1; 748 | delta += floor(delta / numPoints); 749 | for (/* no initialization */; delta > baseMinusTMin * tMax >> 1; k += base) { 750 | delta = floor(delta / baseMinusTMin); 751 | } 752 | return floor(k + (baseMinusTMin + 1) * delta / (delta + skew)); 753 | } 754 | 755 | /** 756 | * Converts a Punycode string of ASCII-only symbols to a string of Unicode 757 | * symbols. 758 | * @memberOf punycode 759 | * @param {String} input The Punycode string of ASCII-only symbols. 760 | * @returns {String} The resulting string of Unicode symbols. 761 | */ 762 | function decode(input) { 763 | // Don't use UCS-2 764 | var output = [], 765 | inputLength = input.length, 766 | out, 767 | i = 0, 768 | n = initialN, 769 | bias = initialBias, 770 | basic, 771 | j, 772 | index, 773 | oldi, 774 | w, 775 | k, 776 | digit, 777 | t, 778 | /** Cached calculation results */ 779 | baseMinusT; 780 | 781 | // Handle the basic code points: let `basic` be the number of input code 782 | // points before the last delimiter, or `0` if there is none, then copy 783 | // the first basic code points to the output. 784 | 785 | basic = input.lastIndexOf(delimiter); 786 | if (basic < 0) { 787 | basic = 0; 788 | } 789 | 790 | for (j = 0; j < basic; ++j) { 791 | // if it's not a basic code point 792 | if (input.charCodeAt(j) >= 0x80) { 793 | error('not-basic'); 794 | } 795 | output.push(input.charCodeAt(j)); 796 | } 797 | 798 | // Main decoding loop: start just after the last delimiter if any basic code 799 | // points were copied; start at the beginning otherwise. 800 | 801 | for (index = basic > 0 ? basic + 1 : 0; index < inputLength; /* no final expression */) { 802 | 803 | // `index` is the index of the next character to be consumed. 804 | // Decode a generalized variable-length integer into `delta`, 805 | // which gets added to `i`. The overflow checking is easier 806 | // if we increase `i` as we go, then subtract off its starting 807 | // value at the end to obtain `delta`. 808 | for (oldi = i, w = 1, k = base; /* no condition */; k += base) { 809 | 810 | if (index >= inputLength) { 811 | error('invalid-input'); 812 | } 813 | 814 | digit = basicToDigit(input.charCodeAt(index++)); 815 | 816 | if (digit >= base || digit > floor((maxInt - i) / w)) { 817 | error('overflow'); 818 | } 819 | 820 | i += digit * w; 821 | t = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias); 822 | 823 | if (digit < t) { 824 | break; 825 | } 826 | 827 | baseMinusT = base - t; 828 | if (w > floor(maxInt / baseMinusT)) { 829 | error('overflow'); 830 | } 831 | 832 | w *= baseMinusT; 833 | 834 | } 835 | 836 | out = output.length + 1; 837 | bias = adapt(i - oldi, out, oldi == 0); 838 | 839 | // `i` was supposed to wrap around from `out` to `0`, 840 | // incrementing `n` each time, so we'll fix that now: 841 | if (floor(i / out) > maxInt - n) { 842 | error('overflow'); 843 | } 844 | 845 | n += floor(i / out); 846 | i %= out; 847 | 848 | // Insert `n` at position `i` of the output 849 | output.splice(i++, 0, n); 850 | 851 | } 852 | 853 | return ucs2encode(output); 854 | } 855 | 856 | /** 857 | * Converts a string of Unicode symbols (e.g. a domain name label) to a 858 | * Punycode string of ASCII-only symbols. 859 | * @memberOf punycode 860 | * @param {String} input The string of Unicode symbols. 861 | * @returns {String} The resulting Punycode string of ASCII-only symbols. 862 | */ 863 | function encode(input) { 864 | var n, 865 | delta, 866 | handledCPCount, 867 | basicLength, 868 | bias, 869 | j, 870 | m, 871 | q, 872 | k, 873 | t, 874 | currentValue, 875 | output = [], 876 | /** `inputLength` will hold the number of code points in `input`. */ 877 | inputLength, 878 | /** Cached calculation results */ 879 | handledCPCountPlusOne, 880 | baseMinusT, 881 | qMinusT; 882 | 883 | // Convert the input in UCS-2 to Unicode 884 | input = ucs2decode(input); 885 | 886 | // Cache the length 887 | inputLength = input.length; 888 | 889 | // Initialize the state 890 | n = initialN; 891 | delta = 0; 892 | bias = initialBias; 893 | 894 | // Handle the basic code points 895 | for (j = 0; j < inputLength; ++j) { 896 | currentValue = input[j]; 897 | if (currentValue < 0x80) { 898 | output.push(stringFromCharCode(currentValue)); 899 | } 900 | } 901 | 902 | handledCPCount = basicLength = output.length; 903 | 904 | // `handledCPCount` is the number of code points that have been handled; 905 | // `basicLength` is the number of basic code points. 906 | 907 | // Finish the basic string - if it is not empty - with a delimiter 908 | if (basicLength) { 909 | output.push(delimiter); 910 | } 911 | 912 | // Main encoding loop: 913 | while (handledCPCount < inputLength) { 914 | 915 | // All non-basic code points < n have been handled already. Find the next 916 | // larger one: 917 | for (m = maxInt, j = 0; j < inputLength; ++j) { 918 | currentValue = input[j]; 919 | if (currentValue >= n && currentValue < m) { 920 | m = currentValue; 921 | } 922 | } 923 | 924 | // Increase `delta` enough to advance the decoder's state to , 925 | // but guard against overflow 926 | handledCPCountPlusOne = handledCPCount + 1; 927 | if (m - n > floor((maxInt - delta) / handledCPCountPlusOne)) { 928 | error('overflow'); 929 | } 930 | 931 | delta += (m - n) * handledCPCountPlusOne; 932 | n = m; 933 | 934 | for (j = 0; j < inputLength; ++j) { 935 | currentValue = input[j]; 936 | 937 | if (currentValue < n && ++delta > maxInt) { 938 | error('overflow'); 939 | } 940 | 941 | if (currentValue == n) { 942 | // Represent delta as a generalized variable-length integer 943 | for (q = delta, k = base; /* no condition */; k += base) { 944 | t = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias); 945 | if (q < t) { 946 | break; 947 | } 948 | qMinusT = q - t; 949 | baseMinusT = base - t; 950 | output.push( 951 | stringFromCharCode(digitToBasic(t + qMinusT % baseMinusT, 0)) 952 | ); 953 | q = floor(qMinusT / baseMinusT); 954 | } 955 | 956 | output.push(stringFromCharCode(digitToBasic(q, 0))); 957 | bias = adapt(delta, handledCPCountPlusOne, handledCPCount == basicLength); 958 | delta = 0; 959 | ++handledCPCount; 960 | } 961 | } 962 | 963 | ++delta; 964 | ++n; 965 | 966 | } 967 | return output.join(''); 968 | } 969 | 970 | /** 971 | * Converts a Punycode string representing a domain name or an email address 972 | * to Unicode. Only the Punycoded parts of the input will be converted, i.e. 973 | * it doesn't matter if you call it on a string that has already been 974 | * converted to Unicode. 975 | * @memberOf punycode 976 | * @param {String} input The Punycoded domain name or email address to 977 | * convert to Unicode. 978 | * @returns {String} The Unicode representation of the given Punycode 979 | * string. 980 | */ 981 | function toUnicode(input) { 982 | return mapDomain(input, function(string) { 983 | return regexPunycode.test(string) 984 | ? decode(string.slice(4).toLowerCase()) 985 | : string; 986 | }); 987 | } 988 | 989 | /** 990 | * Converts a Unicode string representing a domain name or an email address to 991 | * Punycode. Only the non-ASCII parts of the domain name will be converted, 992 | * i.e. it doesn't matter if you call it with a domain that's already in 993 | * ASCII. 994 | * @memberOf punycode 995 | * @param {String} input The domain name or email address to convert, as a 996 | * Unicode string. 997 | * @returns {String} The Punycode representation of the given domain name or 998 | * email address. 999 | */ 1000 | function toASCII(input) { 1001 | return mapDomain(input, function(string) { 1002 | return regexNonASCII.test(string) 1003 | ? 'xn--' + encode(string) 1004 | : string; 1005 | }); 1006 | } 1007 | 1008 | /*--------------------------------------------------------------------------*/ 1009 | 1010 | /** Define the public API */ 1011 | punycode = { 1012 | /** 1013 | * A string representing the current Punycode.js version number. 1014 | * @memberOf punycode 1015 | * @type String 1016 | */ 1017 | 'version': '1.4.1', 1018 | /** 1019 | * An object of methods to convert from JavaScript's internal character 1020 | * representation (UCS-2) to Unicode code points, and back. 1021 | * @see 1022 | * @memberOf punycode 1023 | * @type Object 1024 | */ 1025 | 'ucs2': { 1026 | 'decode': ucs2decode, 1027 | 'encode': ucs2encode 1028 | }, 1029 | 'decode': decode, 1030 | 'encode': encode, 1031 | 'toASCII': toASCII, 1032 | 'toUnicode': toUnicode 1033 | }; 1034 | 1035 | /** Expose `punycode` */ 1036 | // Some AMD build optimizers, like r.js, check for specific condition patterns 1037 | // like the following: 1038 | if ( 1039 | true 1040 | ) { 1041 | !(__WEBPACK_AMD_DEFINE_RESULT__ = function() { 1042 | return punycode; 1043 | }.call(exports, __webpack_require__, exports, module), 1044 | __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); 1045 | } else if (freeExports && freeModule) { 1046 | if (module.exports == freeExports) { 1047 | // in Node.js, io.js, or RingoJS v0.8.0+ 1048 | freeModule.exports = punycode; 1049 | } else { 1050 | // in Narwhal or RingoJS v0.7.0- 1051 | for (key in punycode) { 1052 | punycode.hasOwnProperty(key) && (freeExports[key] = punycode[key]); 1053 | } 1054 | } 1055 | } else { 1056 | // in Rhino or a web browser 1057 | root.punycode = punycode; 1058 | } 1059 | 1060 | }(this)); 1061 | 1062 | /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__("./node_modules/webpack/buildin/module.js")(module), __webpack_require__("./node_modules/webpack/buildin/global.js"))) 1063 | 1064 | /***/ }), 1065 | 1066 | /***/ "./node_modules/query-string/index.js": 1067 | /***/ (function(module, exports, __webpack_require__) { 1068 | 1069 | "use strict"; 1070 | 1071 | var strictUriEncode = __webpack_require__("./node_modules/strict-uri-encode/index.js"); 1072 | var objectAssign = __webpack_require__("./node_modules/object-assign/index.js"); 1073 | 1074 | function encoderForArrayFormat(opts) { 1075 | switch (opts.arrayFormat) { 1076 | case 'index': 1077 | return function (key, value, index) { 1078 | return value === null ? [ 1079 | encode(key, opts), 1080 | '[', 1081 | index, 1082 | ']' 1083 | ].join('') : [ 1084 | encode(key, opts), 1085 | '[', 1086 | encode(index, opts), 1087 | ']=', 1088 | encode(value, opts) 1089 | ].join(''); 1090 | }; 1091 | 1092 | case 'bracket': 1093 | return function (key, value) { 1094 | return value === null ? encode(key, opts) : [ 1095 | encode(key, opts), 1096 | '[]=', 1097 | encode(value, opts) 1098 | ].join(''); 1099 | }; 1100 | 1101 | default: 1102 | return function (key, value) { 1103 | return value === null ? encode(key, opts) : [ 1104 | encode(key, opts), 1105 | '=', 1106 | encode(value, opts) 1107 | ].join(''); 1108 | }; 1109 | } 1110 | } 1111 | 1112 | function parserForArrayFormat(opts) { 1113 | var result; 1114 | 1115 | switch (opts.arrayFormat) { 1116 | case 'index': 1117 | return function (key, value, accumulator) { 1118 | result = /\[(\d*)\]$/.exec(key); 1119 | 1120 | key = key.replace(/\[\d*\]$/, ''); 1121 | 1122 | if (!result) { 1123 | accumulator[key] = value; 1124 | return; 1125 | } 1126 | 1127 | if (accumulator[key] === undefined) { 1128 | accumulator[key] = {}; 1129 | } 1130 | 1131 | accumulator[key][result[1]] = value; 1132 | }; 1133 | 1134 | case 'bracket': 1135 | return function (key, value, accumulator) { 1136 | result = /(\[\])$/.exec(key); 1137 | key = key.replace(/\[\]$/, ''); 1138 | 1139 | if (!result) { 1140 | accumulator[key] = value; 1141 | return; 1142 | } else if (accumulator[key] === undefined) { 1143 | accumulator[key] = [value]; 1144 | return; 1145 | } 1146 | 1147 | accumulator[key] = [].concat(accumulator[key], value); 1148 | }; 1149 | 1150 | default: 1151 | return function (key, value, accumulator) { 1152 | if (accumulator[key] === undefined) { 1153 | accumulator[key] = value; 1154 | return; 1155 | } 1156 | 1157 | accumulator[key] = [].concat(accumulator[key], value); 1158 | }; 1159 | } 1160 | } 1161 | 1162 | function encode(value, opts) { 1163 | if (opts.encode) { 1164 | return opts.strict ? strictUriEncode(value) : encodeURIComponent(value); 1165 | } 1166 | 1167 | return value; 1168 | } 1169 | 1170 | function keysSorter(input) { 1171 | if (Array.isArray(input)) { 1172 | return input.sort(); 1173 | } else if (typeof input === 'object') { 1174 | return keysSorter(Object.keys(input)).sort(function (a, b) { 1175 | return Number(a) - Number(b); 1176 | }).map(function (key) { 1177 | return input[key]; 1178 | }); 1179 | } 1180 | 1181 | return input; 1182 | } 1183 | 1184 | exports.extract = function (str) { 1185 | return str.split('?')[1] || ''; 1186 | }; 1187 | 1188 | exports.parse = function (str, opts) { 1189 | opts = objectAssign({arrayFormat: 'none'}, opts); 1190 | 1191 | var formatter = parserForArrayFormat(opts); 1192 | 1193 | // Create an object with no prototype 1194 | // https://github.com/sindresorhus/query-string/issues/47 1195 | var ret = Object.create(null); 1196 | 1197 | if (typeof str !== 'string') { 1198 | return ret; 1199 | } 1200 | 1201 | str = str.trim().replace(/^(\?|#|&)/, ''); 1202 | 1203 | if (!str) { 1204 | return ret; 1205 | } 1206 | 1207 | str.split('&').forEach(function (param) { 1208 | var parts = param.replace(/\+/g, ' ').split('='); 1209 | // Firefox (pre 40) decodes `%3D` to `=` 1210 | // https://github.com/sindresorhus/query-string/pull/37 1211 | var key = parts.shift(); 1212 | var val = parts.length > 0 ? parts.join('=') : undefined; 1213 | 1214 | // missing `=` should be `null`: 1215 | // http://w3.org/TR/2012/WD-url-20120524/#collect-url-parameters 1216 | val = val === undefined ? null : decodeURIComponent(val); 1217 | 1218 | formatter(decodeURIComponent(key), val, ret); 1219 | }); 1220 | 1221 | return Object.keys(ret).sort().reduce(function (result, key) { 1222 | var val = ret[key]; 1223 | if (Boolean(val) && typeof val === 'object' && !Array.isArray(val)) { 1224 | // Sort object keys, not values 1225 | result[key] = keysSorter(val); 1226 | } else { 1227 | result[key] = val; 1228 | } 1229 | 1230 | return result; 1231 | }, Object.create(null)); 1232 | }; 1233 | 1234 | exports.stringify = function (obj, opts) { 1235 | var defaults = { 1236 | encode: true, 1237 | strict: true, 1238 | arrayFormat: 'none' 1239 | }; 1240 | 1241 | opts = objectAssign(defaults, opts); 1242 | 1243 | var formatter = encoderForArrayFormat(opts); 1244 | 1245 | return obj ? Object.keys(obj).sort().map(function (key) { 1246 | var val = obj[key]; 1247 | 1248 | if (val === undefined) { 1249 | return ''; 1250 | } 1251 | 1252 | if (val === null) { 1253 | return encode(key, opts); 1254 | } 1255 | 1256 | if (Array.isArray(val)) { 1257 | var result = []; 1258 | 1259 | val.slice().forEach(function (val2) { 1260 | if (val2 === undefined) { 1261 | return; 1262 | } 1263 | 1264 | result.push(formatter(key, val2, result.length)); 1265 | }); 1266 | 1267 | return result.join('&'); 1268 | } 1269 | 1270 | return encode(key, opts) + '=' + encode(val, opts); 1271 | }).filter(function (x) { 1272 | return x.length > 0; 1273 | }).join('&') : ''; 1274 | }; 1275 | 1276 | 1277 | /***/ }), 1278 | 1279 | /***/ "./node_modules/querystring-es3/decode.js": 1280 | /***/ (function(module, exports, __webpack_require__) { 1281 | 1282 | "use strict"; 1283 | // Copyright Joyent, Inc. and other Node contributors. 1284 | // 1285 | // Permission is hereby granted, free of charge, to any person obtaining a 1286 | // copy of this software and associated documentation files (the 1287 | // "Software"), to deal in the Software without restriction, including 1288 | // without limitation the rights to use, copy, modify, merge, publish, 1289 | // distribute, sublicense, and/or sell copies of the Software, and to permit 1290 | // persons to whom the Software is furnished to do so, subject to the 1291 | // following conditions: 1292 | // 1293 | // The above copyright notice and this permission notice shall be included 1294 | // in all copies or substantial portions of the Software. 1295 | // 1296 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 1297 | // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 1298 | // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN 1299 | // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 1300 | // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 1301 | // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE 1302 | // USE OR OTHER DEALINGS IN THE SOFTWARE. 1303 | 1304 | 1305 | 1306 | // If obj.hasOwnProperty has been overridden, then calling 1307 | // obj.hasOwnProperty(prop) will break. 1308 | // See: https://github.com/joyent/node/issues/1707 1309 | function hasOwnProperty(obj, prop) { 1310 | return Object.prototype.hasOwnProperty.call(obj, prop); 1311 | } 1312 | 1313 | module.exports = function(qs, sep, eq, options) { 1314 | sep = sep || '&'; 1315 | eq = eq || '='; 1316 | var obj = {}; 1317 | 1318 | if (typeof qs !== 'string' || qs.length === 0) { 1319 | return obj; 1320 | } 1321 | 1322 | var regexp = /\+/g; 1323 | qs = qs.split(sep); 1324 | 1325 | var maxKeys = 1000; 1326 | if (options && typeof options.maxKeys === 'number') { 1327 | maxKeys = options.maxKeys; 1328 | } 1329 | 1330 | var len = qs.length; 1331 | // maxKeys <= 0 means that we should not limit keys count 1332 | if (maxKeys > 0 && len > maxKeys) { 1333 | len = maxKeys; 1334 | } 1335 | 1336 | for (var i = 0; i < len; ++i) { 1337 | var x = qs[i].replace(regexp, '%20'), 1338 | idx = x.indexOf(eq), 1339 | kstr, vstr, k, v; 1340 | 1341 | if (idx >= 0) { 1342 | kstr = x.substr(0, idx); 1343 | vstr = x.substr(idx + 1); 1344 | } else { 1345 | kstr = x; 1346 | vstr = ''; 1347 | } 1348 | 1349 | k = decodeURIComponent(kstr); 1350 | v = decodeURIComponent(vstr); 1351 | 1352 | if (!hasOwnProperty(obj, k)) { 1353 | obj[k] = v; 1354 | } else if (isArray(obj[k])) { 1355 | obj[k].push(v); 1356 | } else { 1357 | obj[k] = [obj[k], v]; 1358 | } 1359 | } 1360 | 1361 | return obj; 1362 | }; 1363 | 1364 | var isArray = Array.isArray || function (xs) { 1365 | return Object.prototype.toString.call(xs) === '[object Array]'; 1366 | }; 1367 | 1368 | 1369 | /***/ }), 1370 | 1371 | /***/ "./node_modules/querystring-es3/encode.js": 1372 | /***/ (function(module, exports, __webpack_require__) { 1373 | 1374 | "use strict"; 1375 | // Copyright Joyent, Inc. and other Node contributors. 1376 | // 1377 | // Permission is hereby granted, free of charge, to any person obtaining a 1378 | // copy of this software and associated documentation files (the 1379 | // "Software"), to deal in the Software without restriction, including 1380 | // without limitation the rights to use, copy, modify, merge, publish, 1381 | // distribute, sublicense, and/or sell copies of the Software, and to permit 1382 | // persons to whom the Software is furnished to do so, subject to the 1383 | // following conditions: 1384 | // 1385 | // The above copyright notice and this permission notice shall be included 1386 | // in all copies or substantial portions of the Software. 1387 | // 1388 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 1389 | // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 1390 | // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN 1391 | // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 1392 | // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 1393 | // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE 1394 | // USE OR OTHER DEALINGS IN THE SOFTWARE. 1395 | 1396 | 1397 | 1398 | var stringifyPrimitive = function(v) { 1399 | switch (typeof v) { 1400 | case 'string': 1401 | return v; 1402 | 1403 | case 'boolean': 1404 | return v ? 'true' : 'false'; 1405 | 1406 | case 'number': 1407 | return isFinite(v) ? v : ''; 1408 | 1409 | default: 1410 | return ''; 1411 | } 1412 | }; 1413 | 1414 | module.exports = function(obj, sep, eq, name) { 1415 | sep = sep || '&'; 1416 | eq = eq || '='; 1417 | if (obj === null) { 1418 | obj = undefined; 1419 | } 1420 | 1421 | if (typeof obj === 'object') { 1422 | return map(objectKeys(obj), function(k) { 1423 | var ks = encodeURIComponent(stringifyPrimitive(k)) + eq; 1424 | if (isArray(obj[k])) { 1425 | return map(obj[k], function(v) { 1426 | return ks + encodeURIComponent(stringifyPrimitive(v)); 1427 | }).join(sep); 1428 | } else { 1429 | return ks + encodeURIComponent(stringifyPrimitive(obj[k])); 1430 | } 1431 | }).join(sep); 1432 | 1433 | } 1434 | 1435 | if (!name) return ''; 1436 | return encodeURIComponent(stringifyPrimitive(name)) + eq + 1437 | encodeURIComponent(stringifyPrimitive(obj)); 1438 | }; 1439 | 1440 | var isArray = Array.isArray || function (xs) { 1441 | return Object.prototype.toString.call(xs) === '[object Array]'; 1442 | }; 1443 | 1444 | function map (xs, f) { 1445 | if (xs.map) return xs.map(f); 1446 | var res = []; 1447 | for (var i = 0; i < xs.length; i++) { 1448 | res.push(f(xs[i], i)); 1449 | } 1450 | return res; 1451 | } 1452 | 1453 | var objectKeys = Object.keys || function (obj) { 1454 | var res = []; 1455 | for (var key in obj) { 1456 | if (Object.prototype.hasOwnProperty.call(obj, key)) res.push(key); 1457 | } 1458 | return res; 1459 | }; 1460 | 1461 | 1462 | /***/ }), 1463 | 1464 | /***/ "./node_modules/querystring-es3/index.js": 1465 | /***/ (function(module, exports, __webpack_require__) { 1466 | 1467 | "use strict"; 1468 | 1469 | 1470 | exports.decode = exports.parse = __webpack_require__("./node_modules/querystring-es3/decode.js"); 1471 | exports.encode = exports.stringify = __webpack_require__("./node_modules/querystring-es3/encode.js"); 1472 | 1473 | 1474 | /***/ }), 1475 | 1476 | /***/ "./node_modules/sort-keys/index.js": 1477 | /***/ (function(module, exports, __webpack_require__) { 1478 | 1479 | "use strict"; 1480 | 1481 | var isPlainObj = __webpack_require__("./node_modules/is-plain-obj/index.js"); 1482 | 1483 | module.exports = function (obj, opts) { 1484 | if (!isPlainObj(obj)) { 1485 | throw new TypeError('Expected a plain object'); 1486 | } 1487 | 1488 | opts = opts || {}; 1489 | 1490 | // DEPRECATED 1491 | if (typeof opts === 'function') { 1492 | opts = {compare: opts}; 1493 | } 1494 | 1495 | var deep = opts.deep; 1496 | var seenInput = []; 1497 | var seenOutput = []; 1498 | 1499 | var sortKeys = function (x) { 1500 | var seenIndex = seenInput.indexOf(x); 1501 | 1502 | if (seenIndex !== -1) { 1503 | return seenOutput[seenIndex]; 1504 | } 1505 | 1506 | var ret = {}; 1507 | var keys = Object.keys(x).sort(opts.compare); 1508 | 1509 | seenInput.push(x); 1510 | seenOutput.push(ret); 1511 | 1512 | for (var i = 0; i < keys.length; i++) { 1513 | var key = keys[i]; 1514 | var val = x[key]; 1515 | 1516 | ret[key] = deep && isPlainObj(val) ? sortKeys(val) : val; 1517 | } 1518 | 1519 | return ret; 1520 | }; 1521 | 1522 | return sortKeys(obj); 1523 | }; 1524 | 1525 | 1526 | /***/ }), 1527 | 1528 | /***/ "./node_modules/strict-uri-encode/index.js": 1529 | /***/ (function(module, exports, __webpack_require__) { 1530 | 1531 | "use strict"; 1532 | 1533 | module.exports = function (str) { 1534 | return encodeURIComponent(str).replace(/[!'()*]/g, function (c) { 1535 | return '%' + c.charCodeAt(0).toString(16).toUpperCase(); 1536 | }); 1537 | }; 1538 | 1539 | 1540 | /***/ }), 1541 | 1542 | /***/ "./node_modules/url/url.js": 1543 | /***/ (function(module, exports, __webpack_require__) { 1544 | 1545 | "use strict"; 1546 | // Copyright Joyent, Inc. and other Node contributors. 1547 | // 1548 | // Permission is hereby granted, free of charge, to any person obtaining a 1549 | // copy of this software and associated documentation files (the 1550 | // "Software"), to deal in the Software without restriction, including 1551 | // without limitation the rights to use, copy, modify, merge, publish, 1552 | // distribute, sublicense, and/or sell copies of the Software, and to permit 1553 | // persons to whom the Software is furnished to do so, subject to the 1554 | // following conditions: 1555 | // 1556 | // The above copyright notice and this permission notice shall be included 1557 | // in all copies or substantial portions of the Software. 1558 | // 1559 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 1560 | // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 1561 | // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN 1562 | // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 1563 | // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 1564 | // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE 1565 | // USE OR OTHER DEALINGS IN THE SOFTWARE. 1566 | 1567 | 1568 | 1569 | var punycode = __webpack_require__("./node_modules/punycode/punycode.js"); 1570 | var util = __webpack_require__("./node_modules/url/util.js"); 1571 | 1572 | exports.parse = urlParse; 1573 | exports.resolve = urlResolve; 1574 | exports.resolveObject = urlResolveObject; 1575 | exports.format = urlFormat; 1576 | 1577 | exports.Url = Url; 1578 | 1579 | function Url() { 1580 | this.protocol = null; 1581 | this.slashes = null; 1582 | this.auth = null; 1583 | this.host = null; 1584 | this.port = null; 1585 | this.hostname = null; 1586 | this.hash = null; 1587 | this.search = null; 1588 | this.query = null; 1589 | this.pathname = null; 1590 | this.path = null; 1591 | this.href = null; 1592 | } 1593 | 1594 | // Reference: RFC 3986, RFC 1808, RFC 2396 1595 | 1596 | // define these here so at least they only have to be 1597 | // compiled once on the first module load. 1598 | var protocolPattern = /^([a-z0-9.+-]+:)/i, 1599 | portPattern = /:[0-9]*$/, 1600 | 1601 | // Special case for a simple path URL 1602 | simplePathPattern = /^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/, 1603 | 1604 | // RFC 2396: characters reserved for delimiting URLs. 1605 | // We actually just auto-escape these. 1606 | delims = ['<', '>', '"', '`', ' ', '\r', '\n', '\t'], 1607 | 1608 | // RFC 2396: characters not allowed for various reasons. 1609 | unwise = ['{', '}', '|', '\\', '^', '`'].concat(delims), 1610 | 1611 | // Allowed by RFCs, but cause of XSS attacks. Always escape these. 1612 | autoEscape = ['\''].concat(unwise), 1613 | // Characters that are never ever allowed in a hostname. 1614 | // Note that any invalid chars are also handled, but these 1615 | // are the ones that are *expected* to be seen, so we fast-path 1616 | // them. 1617 | nonHostChars = ['%', '/', '?', ';', '#'].concat(autoEscape), 1618 | hostEndingChars = ['/', '?', '#'], 1619 | hostnameMaxLen = 255, 1620 | hostnamePartPattern = /^[+a-z0-9A-Z_-]{0,63}$/, 1621 | hostnamePartStart = /^([+a-z0-9A-Z_-]{0,63})(.*)$/, 1622 | // protocols that can allow "unsafe" and "unwise" chars. 1623 | unsafeProtocol = { 1624 | 'javascript': true, 1625 | 'javascript:': true 1626 | }, 1627 | // protocols that never have a hostname. 1628 | hostlessProtocol = { 1629 | 'javascript': true, 1630 | 'javascript:': true 1631 | }, 1632 | // protocols that always contain a // bit. 1633 | slashedProtocol = { 1634 | 'http': true, 1635 | 'https': true, 1636 | 'ftp': true, 1637 | 'gopher': true, 1638 | 'file': true, 1639 | 'http:': true, 1640 | 'https:': true, 1641 | 'ftp:': true, 1642 | 'gopher:': true, 1643 | 'file:': true 1644 | }, 1645 | querystring = __webpack_require__("./node_modules/querystring-es3/index.js"); 1646 | 1647 | function urlParse(url, parseQueryString, slashesDenoteHost) { 1648 | if (url && util.isObject(url) && url instanceof Url) return url; 1649 | 1650 | var u = new Url; 1651 | u.parse(url, parseQueryString, slashesDenoteHost); 1652 | return u; 1653 | } 1654 | 1655 | Url.prototype.parse = function(url, parseQueryString, slashesDenoteHost) { 1656 | if (!util.isString(url)) { 1657 | throw new TypeError("Parameter 'url' must be a string, not " + typeof url); 1658 | } 1659 | 1660 | // Copy chrome, IE, opera backslash-handling behavior. 1661 | // Back slashes before the query string get converted to forward slashes 1662 | // See: https://code.google.com/p/chromium/issues/detail?id=25916 1663 | var queryIndex = url.indexOf('?'), 1664 | splitter = 1665 | (queryIndex !== -1 && queryIndex < url.indexOf('#')) ? '?' : '#', 1666 | uSplit = url.split(splitter), 1667 | slashRegex = /\\/g; 1668 | uSplit[0] = uSplit[0].replace(slashRegex, '/'); 1669 | url = uSplit.join(splitter); 1670 | 1671 | var rest = url; 1672 | 1673 | // trim before proceeding. 1674 | // This is to support parse stuff like " http://foo.com \n" 1675 | rest = rest.trim(); 1676 | 1677 | if (!slashesDenoteHost && url.split('#').length === 1) { 1678 | // Try fast path regexp 1679 | var simplePath = simplePathPattern.exec(rest); 1680 | if (simplePath) { 1681 | this.path = rest; 1682 | this.href = rest; 1683 | this.pathname = simplePath[1]; 1684 | if (simplePath[2]) { 1685 | this.search = simplePath[2]; 1686 | if (parseQueryString) { 1687 | this.query = querystring.parse(this.search.substr(1)); 1688 | } else { 1689 | this.query = this.search.substr(1); 1690 | } 1691 | } else if (parseQueryString) { 1692 | this.search = ''; 1693 | this.query = {}; 1694 | } 1695 | return this; 1696 | } 1697 | } 1698 | 1699 | var proto = protocolPattern.exec(rest); 1700 | if (proto) { 1701 | proto = proto[0]; 1702 | var lowerProto = proto.toLowerCase(); 1703 | this.protocol = lowerProto; 1704 | rest = rest.substr(proto.length); 1705 | } 1706 | 1707 | // figure out if it's got a host 1708 | // user@server is *always* interpreted as a hostname, and url 1709 | // resolution will treat //foo/bar as host=foo,path=bar because that's 1710 | // how the browser resolves relative URLs. 1711 | if (slashesDenoteHost || proto || rest.match(/^\/\/[^@\/]+@[^@\/]+/)) { 1712 | var slashes = rest.substr(0, 2) === '//'; 1713 | if (slashes && !(proto && hostlessProtocol[proto])) { 1714 | rest = rest.substr(2); 1715 | this.slashes = true; 1716 | } 1717 | } 1718 | 1719 | if (!hostlessProtocol[proto] && 1720 | (slashes || (proto && !slashedProtocol[proto]))) { 1721 | 1722 | // there's a hostname. 1723 | // the first instance of /, ?, ;, or # ends the host. 1724 | // 1725 | // If there is an @ in the hostname, then non-host chars *are* allowed 1726 | // to the left of the last @ sign, unless some host-ending character 1727 | // comes *before* the @-sign. 1728 | // URLs are obnoxious. 1729 | // 1730 | // ex: 1731 | // http://a@b@c/ => user:a@b host:c 1732 | // http://a@b?@c => user:a host:c path:/?@c 1733 | 1734 | // v0.12 TODO(isaacs): This is not quite how Chrome does things. 1735 | // Review our test case against browsers more comprehensively. 1736 | 1737 | // find the first instance of any hostEndingChars 1738 | var hostEnd = -1; 1739 | for (var i = 0; i < hostEndingChars.length; i++) { 1740 | var hec = rest.indexOf(hostEndingChars[i]); 1741 | if (hec !== -1 && (hostEnd === -1 || hec < hostEnd)) 1742 | hostEnd = hec; 1743 | } 1744 | 1745 | // at this point, either we have an explicit point where the 1746 | // auth portion cannot go past, or the last @ char is the decider. 1747 | var auth, atSign; 1748 | if (hostEnd === -1) { 1749 | // atSign can be anywhere. 1750 | atSign = rest.lastIndexOf('@'); 1751 | } else { 1752 | // atSign must be in auth portion. 1753 | // http://a@b/c@d => host:b auth:a path:/c@d 1754 | atSign = rest.lastIndexOf('@', hostEnd); 1755 | } 1756 | 1757 | // Now we have a portion which is definitely the auth. 1758 | // Pull that off. 1759 | if (atSign !== -1) { 1760 | auth = rest.slice(0, atSign); 1761 | rest = rest.slice(atSign + 1); 1762 | this.auth = decodeURIComponent(auth); 1763 | } 1764 | 1765 | // the host is the remaining to the left of the first non-host char 1766 | hostEnd = -1; 1767 | for (var i = 0; i < nonHostChars.length; i++) { 1768 | var hec = rest.indexOf(nonHostChars[i]); 1769 | if (hec !== -1 && (hostEnd === -1 || hec < hostEnd)) 1770 | hostEnd = hec; 1771 | } 1772 | // if we still have not hit it, then the entire thing is a host. 1773 | if (hostEnd === -1) 1774 | hostEnd = rest.length; 1775 | 1776 | this.host = rest.slice(0, hostEnd); 1777 | rest = rest.slice(hostEnd); 1778 | 1779 | // pull out port. 1780 | this.parseHost(); 1781 | 1782 | // we've indicated that there is a hostname, 1783 | // so even if it's empty, it has to be present. 1784 | this.hostname = this.hostname || ''; 1785 | 1786 | // if hostname begins with [ and ends with ] 1787 | // assume that it's an IPv6 address. 1788 | var ipv6Hostname = this.hostname[0] === '[' && 1789 | this.hostname[this.hostname.length - 1] === ']'; 1790 | 1791 | // validate a little. 1792 | if (!ipv6Hostname) { 1793 | var hostparts = this.hostname.split(/\./); 1794 | for (var i = 0, l = hostparts.length; i < l; i++) { 1795 | var part = hostparts[i]; 1796 | if (!part) continue; 1797 | if (!part.match(hostnamePartPattern)) { 1798 | var newpart = ''; 1799 | for (var j = 0, k = part.length; j < k; j++) { 1800 | if (part.charCodeAt(j) > 127) { 1801 | // we replace non-ASCII char with a temporary placeholder 1802 | // we need this to make sure size of hostname is not 1803 | // broken by replacing non-ASCII by nothing 1804 | newpart += 'x'; 1805 | } else { 1806 | newpart += part[j]; 1807 | } 1808 | } 1809 | // we test again with ASCII char only 1810 | if (!newpart.match(hostnamePartPattern)) { 1811 | var validParts = hostparts.slice(0, i); 1812 | var notHost = hostparts.slice(i + 1); 1813 | var bit = part.match(hostnamePartStart); 1814 | if (bit) { 1815 | validParts.push(bit[1]); 1816 | notHost.unshift(bit[2]); 1817 | } 1818 | if (notHost.length) { 1819 | rest = '/' + notHost.join('.') + rest; 1820 | } 1821 | this.hostname = validParts.join('.'); 1822 | break; 1823 | } 1824 | } 1825 | } 1826 | } 1827 | 1828 | if (this.hostname.length > hostnameMaxLen) { 1829 | this.hostname = ''; 1830 | } else { 1831 | // hostnames are always lower case. 1832 | this.hostname = this.hostname.toLowerCase(); 1833 | } 1834 | 1835 | if (!ipv6Hostname) { 1836 | // IDNA Support: Returns a punycoded representation of "domain". 1837 | // It only converts parts of the domain name that 1838 | // have non-ASCII characters, i.e. it doesn't matter if 1839 | // you call it with a domain that already is ASCII-only. 1840 | this.hostname = punycode.toASCII(this.hostname); 1841 | } 1842 | 1843 | var p = this.port ? ':' + this.port : ''; 1844 | var h = this.hostname || ''; 1845 | this.host = h + p; 1846 | this.href += this.host; 1847 | 1848 | // strip [ and ] from the hostname 1849 | // the host field still retains them, though 1850 | if (ipv6Hostname) { 1851 | this.hostname = this.hostname.substr(1, this.hostname.length - 2); 1852 | if (rest[0] !== '/') { 1853 | rest = '/' + rest; 1854 | } 1855 | } 1856 | } 1857 | 1858 | // now rest is set to the post-host stuff. 1859 | // chop off any delim chars. 1860 | if (!unsafeProtocol[lowerProto]) { 1861 | 1862 | // First, make 100% sure that any "autoEscape" chars get 1863 | // escaped, even if encodeURIComponent doesn't think they 1864 | // need to be. 1865 | for (var i = 0, l = autoEscape.length; i < l; i++) { 1866 | var ae = autoEscape[i]; 1867 | if (rest.indexOf(ae) === -1) 1868 | continue; 1869 | var esc = encodeURIComponent(ae); 1870 | if (esc === ae) { 1871 | esc = escape(ae); 1872 | } 1873 | rest = rest.split(ae).join(esc); 1874 | } 1875 | } 1876 | 1877 | 1878 | // chop off from the tail first. 1879 | var hash = rest.indexOf('#'); 1880 | if (hash !== -1) { 1881 | // got a fragment string. 1882 | this.hash = rest.substr(hash); 1883 | rest = rest.slice(0, hash); 1884 | } 1885 | var qm = rest.indexOf('?'); 1886 | if (qm !== -1) { 1887 | this.search = rest.substr(qm); 1888 | this.query = rest.substr(qm + 1); 1889 | if (parseQueryString) { 1890 | this.query = querystring.parse(this.query); 1891 | } 1892 | rest = rest.slice(0, qm); 1893 | } else if (parseQueryString) { 1894 | // no query string, but parseQueryString still requested 1895 | this.search = ''; 1896 | this.query = {}; 1897 | } 1898 | if (rest) this.pathname = rest; 1899 | if (slashedProtocol[lowerProto] && 1900 | this.hostname && !this.pathname) { 1901 | this.pathname = '/'; 1902 | } 1903 | 1904 | //to support http.request 1905 | if (this.pathname || this.search) { 1906 | var p = this.pathname || ''; 1907 | var s = this.search || ''; 1908 | this.path = p + s; 1909 | } 1910 | 1911 | // finally, reconstruct the href based on what has been validated. 1912 | this.href = this.format(); 1913 | return this; 1914 | }; 1915 | 1916 | // format a parsed object into a url string 1917 | function urlFormat(obj) { 1918 | // ensure it's an object, and not a string url. 1919 | // If it's an obj, this is a no-op. 1920 | // this way, you can call url_format() on strings 1921 | // to clean up potentially wonky urls. 1922 | if (util.isString(obj)) obj = urlParse(obj); 1923 | if (!(obj instanceof Url)) return Url.prototype.format.call(obj); 1924 | return obj.format(); 1925 | } 1926 | 1927 | Url.prototype.format = function() { 1928 | var auth = this.auth || ''; 1929 | if (auth) { 1930 | auth = encodeURIComponent(auth); 1931 | auth = auth.replace(/%3A/i, ':'); 1932 | auth += '@'; 1933 | } 1934 | 1935 | var protocol = this.protocol || '', 1936 | pathname = this.pathname || '', 1937 | hash = this.hash || '', 1938 | host = false, 1939 | query = ''; 1940 | 1941 | if (this.host) { 1942 | host = auth + this.host; 1943 | } else if (this.hostname) { 1944 | host = auth + (this.hostname.indexOf(':') === -1 ? 1945 | this.hostname : 1946 | '[' + this.hostname + ']'); 1947 | if (this.port) { 1948 | host += ':' + this.port; 1949 | } 1950 | } 1951 | 1952 | if (this.query && 1953 | util.isObject(this.query) && 1954 | Object.keys(this.query).length) { 1955 | query = querystring.stringify(this.query); 1956 | } 1957 | 1958 | var search = this.search || (query && ('?' + query)) || ''; 1959 | 1960 | if (protocol && protocol.substr(-1) !== ':') protocol += ':'; 1961 | 1962 | // only the slashedProtocols get the //. Not mailto:, xmpp:, etc. 1963 | // unless they had them to begin with. 1964 | if (this.slashes || 1965 | (!protocol || slashedProtocol[protocol]) && host !== false) { 1966 | host = '//' + (host || ''); 1967 | if (pathname && pathname.charAt(0) !== '/') pathname = '/' + pathname; 1968 | } else if (!host) { 1969 | host = ''; 1970 | } 1971 | 1972 | if (hash && hash.charAt(0) !== '#') hash = '#' + hash; 1973 | if (search && search.charAt(0) !== '?') search = '?' + search; 1974 | 1975 | pathname = pathname.replace(/[?#]/g, function(match) { 1976 | return encodeURIComponent(match); 1977 | }); 1978 | search = search.replace('#', '%23'); 1979 | 1980 | return protocol + host + pathname + search + hash; 1981 | }; 1982 | 1983 | function urlResolve(source, relative) { 1984 | return urlParse(source, false, true).resolve(relative); 1985 | } 1986 | 1987 | Url.prototype.resolve = function(relative) { 1988 | return this.resolveObject(urlParse(relative, false, true)).format(); 1989 | }; 1990 | 1991 | function urlResolveObject(source, relative) { 1992 | if (!source) return relative; 1993 | return urlParse(source, false, true).resolveObject(relative); 1994 | } 1995 | 1996 | Url.prototype.resolveObject = function(relative) { 1997 | if (util.isString(relative)) { 1998 | var rel = new Url(); 1999 | rel.parse(relative, false, true); 2000 | relative = rel; 2001 | } 2002 | 2003 | var result = new Url(); 2004 | var tkeys = Object.keys(this); 2005 | for (var tk = 0; tk < tkeys.length; tk++) { 2006 | var tkey = tkeys[tk]; 2007 | result[tkey] = this[tkey]; 2008 | } 2009 | 2010 | // hash is always overridden, no matter what. 2011 | // even href="" will remove it. 2012 | result.hash = relative.hash; 2013 | 2014 | // if the relative url is empty, then there's nothing left to do here. 2015 | if (relative.href === '') { 2016 | result.href = result.format(); 2017 | return result; 2018 | } 2019 | 2020 | // hrefs like //foo/bar always cut to the protocol. 2021 | if (relative.slashes && !relative.protocol) { 2022 | // take everything except the protocol from relative 2023 | var rkeys = Object.keys(relative); 2024 | for (var rk = 0; rk < rkeys.length; rk++) { 2025 | var rkey = rkeys[rk]; 2026 | if (rkey !== 'protocol') 2027 | result[rkey] = relative[rkey]; 2028 | } 2029 | 2030 | //urlParse appends trailing / to urls like http://www.example.com 2031 | if (slashedProtocol[result.protocol] && 2032 | result.hostname && !result.pathname) { 2033 | result.path = result.pathname = '/'; 2034 | } 2035 | 2036 | result.href = result.format(); 2037 | return result; 2038 | } 2039 | 2040 | if (relative.protocol && relative.protocol !== result.protocol) { 2041 | // if it's a known url protocol, then changing 2042 | // the protocol does weird things 2043 | // first, if it's not file:, then we MUST have a host, 2044 | // and if there was a path 2045 | // to begin with, then we MUST have a path. 2046 | // if it is file:, then the host is dropped, 2047 | // because that's known to be hostless. 2048 | // anything else is assumed to be absolute. 2049 | if (!slashedProtocol[relative.protocol]) { 2050 | var keys = Object.keys(relative); 2051 | for (var v = 0; v < keys.length; v++) { 2052 | var k = keys[v]; 2053 | result[k] = relative[k]; 2054 | } 2055 | result.href = result.format(); 2056 | return result; 2057 | } 2058 | 2059 | result.protocol = relative.protocol; 2060 | if (!relative.host && !hostlessProtocol[relative.protocol]) { 2061 | var relPath = (relative.pathname || '').split('/'); 2062 | while (relPath.length && !(relative.host = relPath.shift())); 2063 | if (!relative.host) relative.host = ''; 2064 | if (!relative.hostname) relative.hostname = ''; 2065 | if (relPath[0] !== '') relPath.unshift(''); 2066 | if (relPath.length < 2) relPath.unshift(''); 2067 | result.pathname = relPath.join('/'); 2068 | } else { 2069 | result.pathname = relative.pathname; 2070 | } 2071 | result.search = relative.search; 2072 | result.query = relative.query; 2073 | result.host = relative.host || ''; 2074 | result.auth = relative.auth; 2075 | result.hostname = relative.hostname || relative.host; 2076 | result.port = relative.port; 2077 | // to support http.request 2078 | if (result.pathname || result.search) { 2079 | var p = result.pathname || ''; 2080 | var s = result.search || ''; 2081 | result.path = p + s; 2082 | } 2083 | result.slashes = result.slashes || relative.slashes; 2084 | result.href = result.format(); 2085 | return result; 2086 | } 2087 | 2088 | var isSourceAbs = (result.pathname && result.pathname.charAt(0) === '/'), 2089 | isRelAbs = ( 2090 | relative.host || 2091 | relative.pathname && relative.pathname.charAt(0) === '/' 2092 | ), 2093 | mustEndAbs = (isRelAbs || isSourceAbs || 2094 | (result.host && relative.pathname)), 2095 | removeAllDots = mustEndAbs, 2096 | srcPath = result.pathname && result.pathname.split('/') || [], 2097 | relPath = relative.pathname && relative.pathname.split('/') || [], 2098 | psychotic = result.protocol && !slashedProtocol[result.protocol]; 2099 | 2100 | // if the url is a non-slashed url, then relative 2101 | // links like ../.. should be able 2102 | // to crawl up to the hostname, as well. This is strange. 2103 | // result.protocol has already been set by now. 2104 | // Later on, put the first path part into the host field. 2105 | if (psychotic) { 2106 | result.hostname = ''; 2107 | result.port = null; 2108 | if (result.host) { 2109 | if (srcPath[0] === '') srcPath[0] = result.host; 2110 | else srcPath.unshift(result.host); 2111 | } 2112 | result.host = ''; 2113 | if (relative.protocol) { 2114 | relative.hostname = null; 2115 | relative.port = null; 2116 | if (relative.host) { 2117 | if (relPath[0] === '') relPath[0] = relative.host; 2118 | else relPath.unshift(relative.host); 2119 | } 2120 | relative.host = null; 2121 | } 2122 | mustEndAbs = mustEndAbs && (relPath[0] === '' || srcPath[0] === ''); 2123 | } 2124 | 2125 | if (isRelAbs) { 2126 | // it's absolute. 2127 | result.host = (relative.host || relative.host === '') ? 2128 | relative.host : result.host; 2129 | result.hostname = (relative.hostname || relative.hostname === '') ? 2130 | relative.hostname : result.hostname; 2131 | result.search = relative.search; 2132 | result.query = relative.query; 2133 | srcPath = relPath; 2134 | // fall through to the dot-handling below. 2135 | } else if (relPath.length) { 2136 | // it's relative 2137 | // throw away the existing file, and take the new path instead. 2138 | if (!srcPath) srcPath = []; 2139 | srcPath.pop(); 2140 | srcPath = srcPath.concat(relPath); 2141 | result.search = relative.search; 2142 | result.query = relative.query; 2143 | } else if (!util.isNullOrUndefined(relative.search)) { 2144 | // just pull out the search. 2145 | // like href='?foo'. 2146 | // Put this after the other two cases because it simplifies the booleans 2147 | if (psychotic) { 2148 | result.hostname = result.host = srcPath.shift(); 2149 | //occationaly the auth can get stuck only in host 2150 | //this especially happens in cases like 2151 | //url.resolveObject('mailto:local1@domain1', 'local2@domain2') 2152 | var authInHost = result.host && result.host.indexOf('@') > 0 ? 2153 | result.host.split('@') : false; 2154 | if (authInHost) { 2155 | result.auth = authInHost.shift(); 2156 | result.host = result.hostname = authInHost.shift(); 2157 | } 2158 | } 2159 | result.search = relative.search; 2160 | result.query = relative.query; 2161 | //to support http.request 2162 | if (!util.isNull(result.pathname) || !util.isNull(result.search)) { 2163 | result.path = (result.pathname ? result.pathname : '') + 2164 | (result.search ? result.search : ''); 2165 | } 2166 | result.href = result.format(); 2167 | return result; 2168 | } 2169 | 2170 | if (!srcPath.length) { 2171 | // no path at all. easy. 2172 | // we've already handled the other stuff above. 2173 | result.pathname = null; 2174 | //to support http.request 2175 | if (result.search) { 2176 | result.path = '/' + result.search; 2177 | } else { 2178 | result.path = null; 2179 | } 2180 | result.href = result.format(); 2181 | return result; 2182 | } 2183 | 2184 | // if a url ENDs in . or .., then it must get a trailing slash. 2185 | // however, if it ends in anything else non-slashy, 2186 | // then it must NOT get a trailing slash. 2187 | var last = srcPath.slice(-1)[0]; 2188 | var hasTrailingSlash = ( 2189 | (result.host || relative.host || srcPath.length > 1) && 2190 | (last === '.' || last === '..') || last === ''); 2191 | 2192 | // strip single dots, resolve double dots to parent dir 2193 | // if the path tries to go above the root, `up` ends up > 0 2194 | var up = 0; 2195 | for (var i = srcPath.length; i >= 0; i--) { 2196 | last = srcPath[i]; 2197 | if (last === '.') { 2198 | srcPath.splice(i, 1); 2199 | } else if (last === '..') { 2200 | srcPath.splice(i, 1); 2201 | up++; 2202 | } else if (up) { 2203 | srcPath.splice(i, 1); 2204 | up--; 2205 | } 2206 | } 2207 | 2208 | // if the path is allowed to go above the root, restore leading ..s 2209 | if (!mustEndAbs && !removeAllDots) { 2210 | for (; up--; up) { 2211 | srcPath.unshift('..'); 2212 | } 2213 | } 2214 | 2215 | if (mustEndAbs && srcPath[0] !== '' && 2216 | (!srcPath[0] || srcPath[0].charAt(0) !== '/')) { 2217 | srcPath.unshift(''); 2218 | } 2219 | 2220 | if (hasTrailingSlash && (srcPath.join('/').substr(-1) !== '/')) { 2221 | srcPath.push(''); 2222 | } 2223 | 2224 | var isAbsolute = srcPath[0] === '' || 2225 | (srcPath[0] && srcPath[0].charAt(0) === '/'); 2226 | 2227 | // put the host back 2228 | if (psychotic) { 2229 | result.hostname = result.host = isAbsolute ? '' : 2230 | srcPath.length ? srcPath.shift() : ''; 2231 | //occationaly the auth can get stuck only in host 2232 | //this especially happens in cases like 2233 | //url.resolveObject('mailto:local1@domain1', 'local2@domain2') 2234 | var authInHost = result.host && result.host.indexOf('@') > 0 ? 2235 | result.host.split('@') : false; 2236 | if (authInHost) { 2237 | result.auth = authInHost.shift(); 2238 | result.host = result.hostname = authInHost.shift(); 2239 | } 2240 | } 2241 | 2242 | mustEndAbs = mustEndAbs || (result.host && srcPath.length); 2243 | 2244 | if (mustEndAbs && !isAbsolute) { 2245 | srcPath.unshift(''); 2246 | } 2247 | 2248 | if (!srcPath.length) { 2249 | result.pathname = null; 2250 | result.path = null; 2251 | } else { 2252 | result.pathname = srcPath.join('/'); 2253 | } 2254 | 2255 | //to support request.http 2256 | if (!util.isNull(result.pathname) || !util.isNull(result.search)) { 2257 | result.path = (result.pathname ? result.pathname : '') + 2258 | (result.search ? result.search : ''); 2259 | } 2260 | result.auth = relative.auth || result.auth; 2261 | result.slashes = result.slashes || relative.slashes; 2262 | result.href = result.format(); 2263 | return result; 2264 | }; 2265 | 2266 | Url.prototype.parseHost = function() { 2267 | var host = this.host; 2268 | var port = portPattern.exec(host); 2269 | if (port) { 2270 | port = port[0]; 2271 | if (port !== ':') { 2272 | this.port = port.substr(1); 2273 | } 2274 | host = host.substr(0, host.length - port.length); 2275 | } 2276 | if (host) this.hostname = host; 2277 | }; 2278 | 2279 | 2280 | /***/ }), 2281 | 2282 | /***/ "./node_modules/url/util.js": 2283 | /***/ (function(module, exports, __webpack_require__) { 2284 | 2285 | "use strict"; 2286 | 2287 | 2288 | module.exports = { 2289 | isString: function(arg) { 2290 | return typeof(arg) === 'string'; 2291 | }, 2292 | isObject: function(arg) { 2293 | return typeof(arg) === 'object' && arg !== null; 2294 | }, 2295 | isNull: function(arg) { 2296 | return arg === null; 2297 | }, 2298 | isNullOrUndefined: function(arg) { 2299 | return arg == null; 2300 | } 2301 | }; 2302 | 2303 | 2304 | /***/ }), 2305 | 2306 | /***/ "./node_modules/vue-hot-reload-api/dist/index.js": 2307 | /***/ (function(module, exports) { 2308 | 2309 | var Vue // late bind 2310 | var version 2311 | var map = (window.__VUE_HOT_MAP__ = Object.create(null)) 2312 | var installed = false 2313 | var isBrowserify = false 2314 | var initHookName = 'beforeCreate' 2315 | 2316 | exports.install = function (vue, browserify) { 2317 | if (installed) { return } 2318 | installed = true 2319 | 2320 | Vue = vue.__esModule ? vue.default : vue 2321 | version = Vue.version.split('.').map(Number) 2322 | isBrowserify = browserify 2323 | 2324 | // compat with < 2.0.0-alpha.7 2325 | if (Vue.config._lifecycleHooks.indexOf('init') > -1) { 2326 | initHookName = 'init' 2327 | } 2328 | 2329 | exports.compatible = version[0] >= 2 2330 | if (!exports.compatible) { 2331 | console.warn( 2332 | '[HMR] You are using a version of vue-hot-reload-api that is ' + 2333 | 'only compatible with Vue.js core ^2.0.0.' 2334 | ) 2335 | return 2336 | } 2337 | } 2338 | 2339 | /** 2340 | * Create a record for a hot module, which keeps track of its constructor 2341 | * and instances 2342 | * 2343 | * @param {String} id 2344 | * @param {Object} options 2345 | */ 2346 | 2347 | exports.createRecord = function (id, options) { 2348 | var Ctor = null 2349 | if (typeof options === 'function') { 2350 | Ctor = options 2351 | options = Ctor.options 2352 | } 2353 | makeOptionsHot(id, options) 2354 | map[id] = { 2355 | Ctor: Ctor, 2356 | options: options, 2357 | instances: [] 2358 | } 2359 | } 2360 | 2361 | /** 2362 | * Make a Component options object hot. 2363 | * 2364 | * @param {String} id 2365 | * @param {Object} options 2366 | */ 2367 | 2368 | function makeOptionsHot(id, options) { 2369 | if (options.functional) { 2370 | var render = options.render 2371 | options.render = function (h, ctx) { 2372 | var instances = map[id].instances 2373 | if (instances.indexOf(ctx.parent) < 0) { 2374 | instances.push(ctx.parent) 2375 | } 2376 | return render(h, ctx) 2377 | } 2378 | } else { 2379 | injectHook(options, initHookName, function() { 2380 | var record = map[id] 2381 | if (!record.Ctor) { 2382 | record.Ctor = this.constructor 2383 | } 2384 | record.instances.push(this) 2385 | }) 2386 | injectHook(options, 'beforeDestroy', function() { 2387 | var instances = map[id].instances 2388 | instances.splice(instances.indexOf(this), 1) 2389 | }) 2390 | } 2391 | } 2392 | 2393 | /** 2394 | * Inject a hook to a hot reloadable component so that 2395 | * we can keep track of it. 2396 | * 2397 | * @param {Object} options 2398 | * @param {String} name 2399 | * @param {Function} hook 2400 | */ 2401 | 2402 | function injectHook(options, name, hook) { 2403 | var existing = options[name] 2404 | options[name] = existing 2405 | ? Array.isArray(existing) ? existing.concat(hook) : [existing, hook] 2406 | : [hook] 2407 | } 2408 | 2409 | function tryWrap(fn) { 2410 | return function (id, arg) { 2411 | try { 2412 | fn(id, arg) 2413 | } catch (e) { 2414 | console.error(e) 2415 | console.warn( 2416 | 'Something went wrong during Vue component hot-reload. Full reload required.' 2417 | ) 2418 | } 2419 | } 2420 | } 2421 | 2422 | function updateOptions (oldOptions, newOptions) { 2423 | for (var key in oldOptions) { 2424 | if (!(key in newOptions)) { 2425 | delete oldOptions[key] 2426 | } 2427 | } 2428 | for (var key$1 in newOptions) { 2429 | oldOptions[key$1] = newOptions[key$1] 2430 | } 2431 | } 2432 | 2433 | exports.rerender = tryWrap(function (id, options) { 2434 | var record = map[id] 2435 | if (!options) { 2436 | record.instances.slice().forEach(function (instance) { 2437 | instance.$forceUpdate() 2438 | }) 2439 | return 2440 | } 2441 | if (typeof options === 'function') { 2442 | options = options.options 2443 | } 2444 | if (record.Ctor) { 2445 | record.Ctor.options.render = options.render 2446 | record.Ctor.options.staticRenderFns = options.staticRenderFns 2447 | record.instances.slice().forEach(function (instance) { 2448 | instance.$options.render = options.render 2449 | instance.$options.staticRenderFns = options.staticRenderFns 2450 | // reset static trees 2451 | if (instance._staticTrees) { 2452 | // pre 2.5 staticTrees are cached per-instance 2453 | instance._staticTrees = [] 2454 | } else { 2455 | // post 2.5 staticTrees are cached on shared options 2456 | record.Ctor.options._staticTrees = [] 2457 | } 2458 | instance.$forceUpdate() 2459 | }) 2460 | } else { 2461 | // functional or no instance created yet 2462 | record.options.render = options.render 2463 | record.options.staticRenderFns = options.staticRenderFns 2464 | 2465 | // handle functional component re-render 2466 | if (record.options.functional) { 2467 | // rerender with full options 2468 | if (Object.keys(options).length > 2) { 2469 | updateOptions(record.options, options) 2470 | } else { 2471 | // template-only rerender. 2472 | // need to inject the style injection code for CSS modules 2473 | // to work properly. 2474 | var injectStyles = record.options._injectStyles 2475 | if (injectStyles) { 2476 | var render = options.render 2477 | record.options.render = function (h, ctx) { 2478 | injectStyles.call(ctx) 2479 | return render(h, ctx) 2480 | } 2481 | } 2482 | } 2483 | record.options._Ctor = null 2484 | record.options._staticTrees = [] 2485 | record.instances.slice().forEach(function (instance) { 2486 | instance.$forceUpdate() 2487 | }) 2488 | } 2489 | } 2490 | }) 2491 | 2492 | exports.reload = tryWrap(function (id, options) { 2493 | var record = map[id] 2494 | if (options) { 2495 | if (typeof options === 'function') { 2496 | options = options.options 2497 | } 2498 | makeOptionsHot(id, options) 2499 | if (record.Ctor) { 2500 | if (version[1] < 2) { 2501 | // preserve pre 2.2 behavior for global mixin handling 2502 | record.Ctor.extendOptions = options 2503 | } 2504 | var newCtor = record.Ctor.super.extend(options) 2505 | record.Ctor.options = newCtor.options 2506 | record.Ctor.cid = newCtor.cid 2507 | record.Ctor.prototype = newCtor.prototype 2508 | if (newCtor.release) { 2509 | // temporary global mixin strategy used in < 2.0.0-alpha.6 2510 | newCtor.release() 2511 | } 2512 | } else { 2513 | updateOptions(record.options, options) 2514 | } 2515 | } 2516 | record.instances.slice().forEach(function (instance) { 2517 | if (instance.$vnode && instance.$vnode.context) { 2518 | instance.$vnode.context.$forceUpdate() 2519 | } else { 2520 | console.warn( 2521 | 'Root or manually mounted instance modified. Full reload required.' 2522 | ) 2523 | } 2524 | }) 2525 | }) 2526 | 2527 | 2528 | /***/ }), 2529 | 2530 | /***/ "./node_modules/vue-loader/lib/component-normalizer.js": 2531 | /***/ (function(module, exports) { 2532 | 2533 | /* globals __VUE_SSR_CONTEXT__ */ 2534 | 2535 | // IMPORTANT: Do NOT use ES2015 features in this file. 2536 | // This module is a runtime utility for cleaner component module output and will 2537 | // be included in the final webpack user bundle. 2538 | 2539 | module.exports = function normalizeComponent ( 2540 | rawScriptExports, 2541 | compiledTemplate, 2542 | functionalTemplate, 2543 | injectStyles, 2544 | scopeId, 2545 | moduleIdentifier /* server only */ 2546 | ) { 2547 | var esModule 2548 | var scriptExports = rawScriptExports = rawScriptExports || {} 2549 | 2550 | // ES6 modules interop 2551 | var type = typeof rawScriptExports.default 2552 | if (type === 'object' || type === 'function') { 2553 | esModule = rawScriptExports 2554 | scriptExports = rawScriptExports.default 2555 | } 2556 | 2557 | // Vue.extend constructor export interop 2558 | var options = typeof scriptExports === 'function' 2559 | ? scriptExports.options 2560 | : scriptExports 2561 | 2562 | // render functions 2563 | if (compiledTemplate) { 2564 | options.render = compiledTemplate.render 2565 | options.staticRenderFns = compiledTemplate.staticRenderFns 2566 | options._compiled = true 2567 | } 2568 | 2569 | // functional template 2570 | if (functionalTemplate) { 2571 | options.functional = true 2572 | } 2573 | 2574 | // scopedId 2575 | if (scopeId) { 2576 | options._scopeId = scopeId 2577 | } 2578 | 2579 | var hook 2580 | if (moduleIdentifier) { // server build 2581 | hook = function (context) { 2582 | // 2.3 injection 2583 | context = 2584 | context || // cached call 2585 | (this.$vnode && this.$vnode.ssrContext) || // stateful 2586 | (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional 2587 | // 2.2 with runInNewContext: true 2588 | if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') { 2589 | context = __VUE_SSR_CONTEXT__ 2590 | } 2591 | // inject component styles 2592 | if (injectStyles) { 2593 | injectStyles.call(this, context) 2594 | } 2595 | // register component module identifier for async chunk inferrence 2596 | if (context && context._registeredComponents) { 2597 | context._registeredComponents.add(moduleIdentifier) 2598 | } 2599 | } 2600 | // used by ssr in case component is cached and beforeCreate 2601 | // never gets called 2602 | options._ssrRegister = hook 2603 | } else if (injectStyles) { 2604 | hook = injectStyles 2605 | } 2606 | 2607 | if (hook) { 2608 | var functional = options.functional 2609 | var existing = functional 2610 | ? options.render 2611 | : options.beforeCreate 2612 | 2613 | if (!functional) { 2614 | // inject component registration as beforeCreate hook 2615 | options.beforeCreate = existing 2616 | ? [].concat(existing, hook) 2617 | : [hook] 2618 | } else { 2619 | // for template-only hot-reload because in that case the render fn doesn't 2620 | // go through the normalizer 2621 | options._injectStyles = hook 2622 | // register for functioal component in vue file 2623 | options.render = function renderWithStyleInjection (h, context) { 2624 | hook.call(context) 2625 | return existing(h, context) 2626 | } 2627 | } 2628 | } 2629 | 2630 | return { 2631 | esModule: esModule, 2632 | exports: scriptExports, 2633 | options: options 2634 | } 2635 | } 2636 | 2637 | 2638 | /***/ }), 2639 | 2640 | /***/ "./node_modules/vue-loader/lib/template-compiler/index.js?{\"id\":\"data-v-184d830b\",\"hasScoped\":false,\"buble\":{\"transforms\":{}}}!./node_modules/vue-loader/lib/selector.js?type=template&index=0&bustCache!./assets/js/components/welcome.vue": 2641 | /***/ (function(module, __webpack_exports__, __webpack_require__) { 2642 | 2643 | "use strict"; 2644 | var render = function() { 2645 | var _vm = this 2646 | var _h = _vm.$createElement 2647 | var _c = _vm._self._c || _h 2648 | return _c("h1", [_vm._v("Welcome to WordVuePack")]) 2649 | } 2650 | var staticRenderFns = [] 2651 | render._withStripped = true 2652 | var esExports = { render: render, staticRenderFns: staticRenderFns } 2653 | /* harmony default export */ __webpack_exports__["a"] = (esExports); 2654 | if (true) { 2655 | module.hot.accept() 2656 | if (module.hot.data) { 2657 | __webpack_require__("./node_modules/vue-hot-reload-api/dist/index.js") .rerender("data-v-184d830b", esExports) 2658 | } 2659 | } 2660 | 2661 | /***/ }), 2662 | 2663 | /***/ "./node_modules/webpack/buildin/module.js": 2664 | /***/ (function(module, exports) { 2665 | 2666 | module.exports = function(module) { 2667 | if(!module.webpackPolyfill) { 2668 | module.deprecate = function() {}; 2669 | module.paths = []; 2670 | // module.parent = undefined by default 2671 | if(!module.children) module.children = []; 2672 | Object.defineProperty(module, "loaded", { 2673 | enumerable: true, 2674 | get: function() { 2675 | return module.l; 2676 | } 2677 | }); 2678 | Object.defineProperty(module, "id", { 2679 | enumerable: true, 2680 | get: function() { 2681 | return module.i; 2682 | } 2683 | }); 2684 | module.webpackPolyfill = 1; 2685 | } 2686 | return module; 2687 | }; 2688 | 2689 | 2690 | /***/ }) 2691 | 2692 | },["./assets/js/app.js"]); -------------------------------------------------------------------------------- /style.css: -------------------------------------------------------------------------------- 1 | /* 2 | Theme Name: WordVuePack 3 | Author: Isaac Ben Hutta 4 | Description: Starter theme with Vue.js integrated 5 | Version: 1.0 6 | License: GNU General Public License v2 or later 7 | License URI: http://www.gnu.org/licenses/gpl-2.0.html 8 | This theme, like WordPress, is licensed under the GPL. 9 | Use it to make something cool, have fun, and share what you've learned with others. 10 | */ -------------------------------------------------------------------------------- /webpack.config.js: -------------------------------------------------------------------------------- 1 | 2 | const path = require('path'); 3 | const webpack = require('webpack'); 4 | const ProgressBarPlugin = require('progress-bar-webpack-plugin'); 5 | const ExtractTextPlugin = require('extract-text-webpack-plugin'); 6 | const browserSync = require('browser-sync'); 7 | 8 | 9 | module.exports = env => { 10 | const config = { 11 | devServer: { 12 | hot: true, 13 | headers: { 'Access-Control-Allow-Origin': '*' } 14 | }, 15 | entry: { 16 | vendor: ['vue', './assets/scss/vendor.scss'], 17 | app: './assets/js/app.js', 18 | }, 19 | output: { 20 | filename: '[name].js', 21 | path: path.resolve(__dirname, 'public/js/'), 22 | publicPath: 'http://localhost:8080/' 23 | }, 24 | module: { 25 | rules: [ 26 | { 27 | test: /\.scss$/, 28 | use: ['css-hot-loader'].concat(ExtractTextPlugin.extract({ 29 | fallback: 'style-loader', 30 | use: ['css-loader', 'postcss-loader', 'sass-loader'] 31 | })), 32 | }, 33 | { 34 | test: /\.js$/, 35 | exclude: /(node_modules)/, 36 | loader: 'babel-loader', 37 | }, 38 | { 39 | test: /\.vue$/, 40 | loader: 'vue-loader', 41 | }, 42 | ] 43 | }, 44 | resolve: { 45 | extensions: ['.js'], 46 | alias: { 47 | 'vue$': 'vue/dist/vue.esm.js' 48 | } 49 | }, 50 | plugins: [ 51 | new ProgressBarPlugin(), 52 | new webpack.NamedModulesPlugin(), 53 | new webpack.optimize.CommonsChunkPlugin({ 54 | names: ['vendor'] 55 | }), 56 | new webpack.HotModuleReplacementPlugin(), 57 | ] 58 | }; 59 | 60 | if (env.server) { 61 | config.plugins.push(new ExtractTextPlugin('[name].css')); 62 | } else { 63 | config.plugins.push(new ExtractTextPlugin('../css/[name].css')); 64 | } 65 | 66 | if (env.browserSync) { 67 | browserSync({ 68 | proxy: 'wordvue.dev', 69 | port: 3000, 70 | files: [ 71 | '**/*.php' 72 | ], 73 | ghostMode: { 74 | clicks: false, 75 | location: false, 76 | forms: false, 77 | scroll: false 78 | }, 79 | injectChanges: true, 80 | logFileChanges: true, 81 | logLevel: 'debug', 82 | logPrefix: 'php-file-change', 83 | notify: false, 84 | reloadDelay: 0 85 | }); 86 | } 87 | 88 | return config; 89 | }; 90 | --------------------------------------------------------------------------------