From 9b0f3c2cc8c323a92ce73d656e205fcff5c3f9b7 Mon Sep 17 00:00:00 2001 From: euvl Date: Mon, 15 May 2017 20:27:05 +0100 Subject: [PATCH] Added vue to webpack.externals, new dist (#21) --- dist/index.js | 9626 +-------------------------------------------- webpack.config.js | 3 + 2 files changed, 127 insertions(+), 9502 deletions(-) diff --git a/dist/index.js b/dist/index.js index 81b8220..f4d19c5 100644 --- a/dist/index.js +++ b/dist/index.js @@ -1,13 +1,13 @@ (function webpackUniversalModuleDefinition(root, factory) { if(typeof exports === 'object' && typeof module === 'object') - module.exports = factory(); + module.exports = factory(require("vue")); else if(typeof define === 'function' && define.amd) - define([], factory); + define(["vue"], factory); else if(typeof exports === 'object') - exports["VueJsModal"] = factory(); + exports["VueJsModal"] = factory(require("vue")); else - root["VueJsModal"] = factory(); -})(this, function() { + root["VueJsModal"] = factory(root["vue"]); +})(this, function(__WEBPACK_EXTERNAL_MODULE_16__) { return /******/ (function(modules) { // webpackBootstrap /******/ // The module cache /******/ var installedModules = {}; @@ -16,9 +16,9 @@ return /******/ (function(modules) { // webpackBootstrap /******/ function __webpack_require__(moduleId) { /******/ /******/ // Check if module is in cache -/******/ if(installedModules[moduleId]) +/******/ if(installedModules[moduleId]) { /******/ return installedModules[moduleId].exports; -/******/ +/******/ } /******/ // Create a new module (and put it into the cache) /******/ var module = installedModules[moduleId] = { /******/ i: moduleId, @@ -70,16 +70,59 @@ return /******/ (function(modules) { // webpackBootstrap /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; /******/ /******/ // __webpack_public_path__ -/******/ __webpack_require__.p = ""; +/******/ __webpack_require__.p = "/dist/"; /******/ /******/ // Load entry module and return exports -/******/ return __webpack_require__(__webpack_require__.s = 4); +/******/ return __webpack_require__(__webpack_require__.s = 0); /******/ }) /************************************************************************/ /******/ ([ /* 0 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { +"use strict"; +Object.defineProperty(__webpack_exports__, "__esModule", { value: true }); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__Modal_vue__ = __webpack_require__(5); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__Modal_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__Modal_vue__); + + +var ModalPlugin = { + install: function install(Vue) { + var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + + if (!this.hasOwnProperty("event")) { + this.event = new Vue(); + } + + var $modal = { + show: function show(name, params) { + ModalPlugin.event.$emit('toggle', name, true, params); + }, + hide: function hide(name, params) { + ModalPlugin.event.$emit('toggle', name, false, params); + }, + toggle: function toggle(name, params) { + ModalPlugin.event.$emit('toggle', name, undefined, params); + } + }; + + Object.defineProperty(Vue.prototype, '$modal', { + get: function get() { + return $modal; + } + }); + + Vue.component('modal', __WEBPACK_IMPORTED_MODULE_0__Modal_vue___default.a); + return null; + } +}; + +/* harmony default export */ __webpack_exports__["default"] = (ModalPlugin); + +/***/ }), +/* 1 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return inRange; }); var inRange = function inRange(from, to, value) { @@ -95,7 +138,7 @@ var inRange = function inRange(from, to, value) { }; /***/ }), -/* 1 */ +/* 2 */ /***/ (function(module, exports) { /* @@ -151,7 +194,7 @@ module.exports = function() { /***/ }), -/* 2 */ +/* 3 */ /***/ (function(module, exports) { module.exports = function normalizeComponent ( @@ -204,7 +247,7 @@ module.exports = function normalizeComponent ( /***/ }), -/* 3 */ +/* 4 */ /***/ (function(module, exports, __webpack_require__) { /* @@ -313,27 +356,6 @@ function addStylesToDom (styles /* Array */) { } } -function listToStyles (parentId, list) { - var styles = [] - var newStyles = {} - for (var i = 0; i < list.length; i++) { - var item = list[i] - var id = item[0] - var css = item[1] - var media = item[2] - var sourceMap = item[3] - var part = { css: css, media: media, sourceMap: sourceMap } - if (!newStyles[id]) { - part.id = parentId + ':0' - styles.push(newStyles[id] = { id: id, parts: [part] }) - } else { - part.id = parentId + ':' + newStyles[id].parts.length - newStyles[id].parts.push(part) - } - } - return styles -} - function createStyleElement () { var styleElement = document.createElement('style') styleElement.type = 'text/css' @@ -344,12 +366,20 @@ function createStyleElement () { function addStyle (obj /* StyleObjectPart */) { var update, remove var styleElement = document.querySelector('style[data-vue-ssr-id~="' + obj.id + '"]') - var hasSSR = styleElement != null - // if in production mode and style is already provided by SSR, - // simply do nothing. - if (hasSSR && isProduction) { - return noop + if (styleElement) { + if (isProduction) { + // has SSR styles and in production mode. + // simply do nothing. + return noop + } else { + // has SSR styles but in dev mode. + // for some reason Chrome can't handle source map in server-rendered + // style tags - source maps in