mirror of
				https://github.com/KevinMidboe/vue-js-modal.git
				synced 2025-10-29 18:00:20 +00:00 
			
		
		
		
	Added "node" target to package.json, updated babelrc
This commit is contained in:
		
							
								
								
									
										2
									
								
								.babelrc
									
									
									
									
									
								
							
							
						
						
									
										2
									
								
								.babelrc
									
									
									
									
									
								
							| @@ -1,4 +1,4 @@ | |||||||
| { | { | ||||||
|   "presets": ["es2015", "stage-2"], |   "presets": ["env"], | ||||||
|   "comments": false |   "comments": false | ||||||
| } | } | ||||||
|   | |||||||
							
								
								
									
										262
									
								
								dist/index.js
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										262
									
								
								dist/index.js
									
									
									
									
										vendored
									
									
								
							| @@ -261,220 +261,84 @@ module.exports = function normalizeComponent ( | |||||||
| /* 4 */ | /* 4 */ | ||||||
| /***/ (function(module, exports, __webpack_require__) { | /***/ (function(module, exports, __webpack_require__) { | ||||||
|  |  | ||||||
| /* |  | ||||||
|   MIT License http://www.opensource.org/licenses/mit-license.php |  | ||||||
|   Author Tobias Koppers @sokra |  | ||||||
|   Modified by Evan You @yyx990803 |  | ||||||
| */ |  | ||||||
|  |  | ||||||
| var hasDocument = typeof document !== 'undefined' |  | ||||||
|  |  | ||||||
| if (typeof DEBUG !== 'undefined' && DEBUG) { |  | ||||||
|   if (!hasDocument) { |  | ||||||
|     throw new Error( |  | ||||||
|     'vue-style-loader cannot be used in a non-browser environment. ' + |  | ||||||
|     "Use { target: 'node' } in your Webpack config to indicate a server-rendering environment." |  | ||||||
|   ) } |  | ||||||
| } |  | ||||||
|  |  | ||||||
| var listToStyles = __webpack_require__(15) | var listToStyles = __webpack_require__(15) | ||||||
|  |  | ||||||
| /* | module.exports = function (parentId, list, isProduction) { | ||||||
| type StyleObject = { |   if (typeof __VUE_SSR_CONTEXT__ !== 'undefined') { | ||||||
|   id: number; |     var context = __VUE_SSR_CONTEXT__ | ||||||
|   parts: Array<StyleObjectPart> |     var styles = context._styles | ||||||
|  |  | ||||||
|  |     if (!styles) { | ||||||
|  |       styles = context._styles = {} | ||||||
|  |       Object.defineProperty(context, 'styles', { | ||||||
|  |         enumberable: true, | ||||||
|  |         get : function() { | ||||||
|  |           return ( | ||||||
|  |             context._renderedStyles || | ||||||
|  |             (context._renderedStyles = renderStyles(styles)) | ||||||
|  |           ) | ||||||
|  |         } | ||||||
|  |       }) | ||||||
|     } |     } | ||||||
|  |  | ||||||
| type StyleObjectPart = { |     list = listToStyles(parentId, list) | ||||||
|   css: string; |  | ||||||
|   media: string; |  | ||||||
|   sourceMap: ?string |  | ||||||
| } |  | ||||||
| */ |  | ||||||
|  |  | ||||||
| var stylesInDom = {/* |  | ||||||
|   [id: number]: { |  | ||||||
|     id: number, |  | ||||||
|     refs: number, |  | ||||||
|     parts: Array<(obj?: StyleObjectPart) => void> |  | ||||||
|   } |  | ||||||
| */} |  | ||||||
|  |  | ||||||
| var head = hasDocument && (document.head || document.getElementsByTagName('head')[0]) |  | ||||||
| var singletonElement = null |  | ||||||
| var singletonCounter = 0 |  | ||||||
| var isProduction = false |  | ||||||
| var noop = function () {} |  | ||||||
|  |  | ||||||
| // Force single-tag solution on IE6-9, which has a hard limit on the # of <style> |  | ||||||
| // tags it will allow on a page |  | ||||||
| var isOldIE = typeof navigator !== 'undefined' && /msie [6-9]\b/.test(navigator.userAgent.toLowerCase()) |  | ||||||
|  |  | ||||||
| module.exports = function (parentId, list, _isProduction) { |  | ||||||
|   isProduction = _isProduction |  | ||||||
|  |  | ||||||
|   var styles = listToStyles(parentId, list) |  | ||||||
|   addStylesToDom(styles) |  | ||||||
|  |  | ||||||
|   return function update (newList) { |  | ||||||
|     var mayRemove = [] |  | ||||||
|     for (var i = 0; i < styles.length; i++) { |  | ||||||
|       var item = styles[i] |  | ||||||
|       var domStyle = stylesInDom[item.id] |  | ||||||
|       domStyle.refs-- |  | ||||||
|       mayRemove.push(domStyle) |  | ||||||
|     } |  | ||||||
|     if (newList) { |  | ||||||
|       styles = listToStyles(parentId, newList) |  | ||||||
|       addStylesToDom(styles) |  | ||||||
|     } else { |  | ||||||
|       styles = [] |  | ||||||
|     } |  | ||||||
|     for (var i = 0; i < mayRemove.length; i++) { |  | ||||||
|       var domStyle = mayRemove[i] |  | ||||||
|       if (domStyle.refs === 0) { |  | ||||||
|         for (var j = 0; j < domStyle.parts.length; j++) { |  | ||||||
|           domStyle.parts[j]() |  | ||||||
|         } |  | ||||||
|         delete stylesInDom[domStyle.id] |  | ||||||
|       } |  | ||||||
|     } |  | ||||||
|   } |  | ||||||
| } |  | ||||||
|  |  | ||||||
| function addStylesToDom (styles /* Array<StyleObject> */) { |  | ||||||
|   for (var i = 0; i < styles.length; i++) { |  | ||||||
|     var item = styles[i] |  | ||||||
|     var domStyle = stylesInDom[item.id] |  | ||||||
|     if (domStyle) { |  | ||||||
|       domStyle.refs++ |  | ||||||
|       for (var j = 0; j < domStyle.parts.length; j++) { |  | ||||||
|         domStyle.parts[j](item.parts[j]) |  | ||||||
|       } |  | ||||||
|       for (; j < item.parts.length; j++) { |  | ||||||
|         domStyle.parts.push(addStyle(item.parts[j])) |  | ||||||
|       } |  | ||||||
|       if (domStyle.parts.length > item.parts.length) { |  | ||||||
|         domStyle.parts.length = item.parts.length |  | ||||||
|       } |  | ||||||
|     } else { |  | ||||||
|       var parts = [] |  | ||||||
|       for (var j = 0; j < item.parts.length; j++) { |  | ||||||
|         parts.push(addStyle(item.parts[j])) |  | ||||||
|       } |  | ||||||
|       stylesInDom[item.id] = { id: item.id, refs: 1, parts: parts } |  | ||||||
|     } |  | ||||||
|   } |  | ||||||
| } |  | ||||||
|  |  | ||||||
| function createStyleElement () { |  | ||||||
|   var styleElement = document.createElement('style') |  | ||||||
|   styleElement.type = 'text/css' |  | ||||||
|   head.appendChild(styleElement) |  | ||||||
|   return styleElement |  | ||||||
| } |  | ||||||
|  |  | ||||||
| function addStyle (obj /* StyleObjectPart */) { |  | ||||||
|   var update, remove |  | ||||||
|   var styleElement = document.querySelector('style[data-vue-ssr-id~="' + obj.id + '"]') |  | ||||||
|  |  | ||||||
|   if (styleElement) { |  | ||||||
|     if (isProduction) { |     if (isProduction) { | ||||||
|       // has SSR styles and in production mode. |       addStyleProd(styles, list) | ||||||
|       // simply do nothing. |  | ||||||
|       return noop |  | ||||||
|     } else { |     } else { | ||||||
|       // has SSR styles but in dev mode. |       addStyleDev(styles, list) | ||||||
|       // for some reason Chrome can't handle source map in server-rendered |     } | ||||||
|       // style tags - source maps in <style> only works if the style tag is |  | ||||||
|       // created and inserted dynamically. So we remove the server rendered |  | ||||||
|       // styles and inject new ones. |  | ||||||
|       styleElement.parentNode.removeChild(styleElement) |  | ||||||
|   } |   } | ||||||
| } | } | ||||||
|  |  | ||||||
|   if (isOldIE) { | // In production, render as few style tags as possible. | ||||||
|     // use singleton mode for IE9. | // (mostly because IE9 has a limit on number of style tags) | ||||||
|     var styleIndex = singletonCounter++ | function addStyleProd (styles, list) { | ||||||
|     styleElement = singletonElement || (singletonElement = createStyleElement()) |   for (var i = 0; i < list.length; i++) { | ||||||
|     update = applyToSingletonTag.bind(null, styleElement, styleIndex, false) |     var parts = list[i].parts | ||||||
|     remove = applyToSingletonTag.bind(null, styleElement, styleIndex, true) |     for (var j = 0; j < parts.length; j++) { | ||||||
|  |       var part = parts[j] | ||||||
|  |       // group style tags by media types. | ||||||
|  |       var id = part.media || 'default' | ||||||
|  |       var style = styles[id] | ||||||
|  |       if (style) { | ||||||
|  |         style.ids.push(part.id) | ||||||
|  |         style.css += '\n' + part.css | ||||||
|       } else { |       } else { | ||||||
|     // use multi-style-tag mode in all other cases |         styles[id] = { | ||||||
|     styleElement = createStyleElement() |           ids: [part.id], | ||||||
|     update = applyToTag.bind(null, styleElement) |           css: part.css, | ||||||
|     remove = function () { |           media: part.media | ||||||
|       styleElement.parentNode.removeChild(styleElement) |         } | ||||||
|  |       } | ||||||
|  |     } | ||||||
|   } |   } | ||||||
| } | } | ||||||
|  |  | ||||||
|   update(obj) | // In dev we use individual style tag for each module for hot-reload | ||||||
|  | // and source maps. | ||||||
|   return function updateStyle (newObj /* StyleObjectPart */) { | function addStyleDev (styles, list) { | ||||||
|     if (newObj) { |   for (var i = 0; i < list.length; i++) { | ||||||
|       if (newObj.css === obj.css && |     var parts = list[i].parts | ||||||
|           newObj.media === obj.media && |     for (var j = 0; j < parts.length; j++) { | ||||||
|           newObj.sourceMap === obj.sourceMap) { |       var part = parts[j] | ||||||
|         return |       styles[part.id] = { | ||||||
|  |         ids: [part.id], | ||||||
|  |         css: part.css, | ||||||
|  |         media: part.media | ||||||
|       } |       } | ||||||
|       update(obj = newObj) |  | ||||||
|     } else { |  | ||||||
|       remove() |  | ||||||
|     } |     } | ||||||
|   } |   } | ||||||
| } | } | ||||||
|  |  | ||||||
| var replaceText = (function () { | function renderStyles (styles) { | ||||||
|   var textStore = [] |   var css = '' | ||||||
|  |   for (var key in styles) { | ||||||
|   return function (index, replacement) { |     var style = styles[key] | ||||||
|     textStore[index] = replacement |     css += '<style data-vue-ssr-id="' + style.ids.join(' ') + '"' + | ||||||
|     return textStore.filter(Boolean).join('\n') |         (style.media ? ( ' media="' + style.media + '"' ) : '') + '>' + | ||||||
|   } |         style.css + '</style>' | ||||||
| })() |  | ||||||
|  |  | ||||||
| function applyToSingletonTag (styleElement, index, remove, obj) { |  | ||||||
|   var css = remove ? '' : obj.css |  | ||||||
|  |  | ||||||
|   if (styleElement.styleSheet) { |  | ||||||
|     styleElement.styleSheet.cssText = replaceText(index, css) |  | ||||||
|   } else { |  | ||||||
|     var cssNode = document.createTextNode(css) |  | ||||||
|     var childNodes = styleElement.childNodes |  | ||||||
|     if (childNodes[index]) styleElement.removeChild(childNodes[index]) |  | ||||||
|     if (childNodes.length) { |  | ||||||
|       styleElement.insertBefore(cssNode, childNodes[index]) |  | ||||||
|     } else { |  | ||||||
|       styleElement.appendChild(cssNode) |  | ||||||
|     } |  | ||||||
|   } |  | ||||||
| } |  | ||||||
|  |  | ||||||
| function applyToTag (styleElement, obj) { |  | ||||||
|   var css = obj.css |  | ||||||
|   var media = obj.media |  | ||||||
|   var sourceMap = obj.sourceMap |  | ||||||
|  |  | ||||||
|   if (media) { |  | ||||||
|     styleElement.setAttribute('media', media) |  | ||||||
|   } |  | ||||||
|  |  | ||||||
|   if (sourceMap) { |  | ||||||
|     // https://developer.chrome.com/devtools/docs/javascript-debugging |  | ||||||
|     // this makes source maps inside style tags work properly in Chrome |  | ||||||
|     css += '\n/*# sourceURL=' + sourceMap.sources[0] + ' */' |  | ||||||
|     // http://stackoverflow.com/a/26603875 |  | ||||||
|     css += '\n/*# sourceMappingURL=data:application/json;base64,' + btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap)))) + ' */' |  | ||||||
|   } |  | ||||||
|  |  | ||||||
|   if (styleElement.styleSheet) { |  | ||||||
|     styleElement.styleSheet.cssText = css |  | ||||||
|   } else { |  | ||||||
|     while (styleElement.firstChild) { |  | ||||||
|       styleElement.removeChild(styleElement.firstChild) |  | ||||||
|     } |  | ||||||
|     styleElement.appendChild(document.createTextNode(css)) |  | ||||||
|   } |   } | ||||||
|  |   return css | ||||||
| } | } | ||||||
|  |  | ||||||
|  |  | ||||||
| @@ -1070,8 +934,8 @@ module.exports={render:function (){var _vm=this;var _h=_vm.$createElement;var _c | |||||||
| var content = __webpack_require__(8); | var content = __webpack_require__(8); | ||||||
| if(typeof content === 'string') content = [[module.i, content, '']]; | if(typeof content === 'string') content = [[module.i, content, '']]; | ||||||
| if(content.locals) module.exports = content.locals; | if(content.locals) module.exports = content.locals; | ||||||
| // add the styles to the DOM | // add CSS to SSR context | ||||||
| var update = __webpack_require__(4)("50c27c50", content, true); | __webpack_require__(4)("50c27c50", content, true); | ||||||
|  |  | ||||||
| /***/ }), | /***/ }), | ||||||
| /* 14 */ | /* 14 */ | ||||||
| @@ -1083,8 +947,8 @@ var update = __webpack_require__(4)("50c27c50", content, true); | |||||||
| var content = __webpack_require__(9); | var content = __webpack_require__(9); | ||||||
| if(typeof content === 'string') content = [[module.i, content, '']]; | if(typeof content === 'string') content = [[module.i, content, '']]; | ||||||
| if(content.locals) module.exports = content.locals; | if(content.locals) module.exports = content.locals; | ||||||
| // add the styles to the DOM | // add CSS to SSR context | ||||||
| var update = __webpack_require__(4)("7054fa02", content, true); | __webpack_require__(4)("7054fa02", content, true); | ||||||
|  |  | ||||||
| /***/ }), | /***/ }), | ||||||
| /* 15 */ | /* 15 */ | ||||||
|   | |||||||
| @@ -24,9 +24,7 @@ | |||||||
|   "devDependencies": { |   "devDependencies": { | ||||||
|     "babel-core": "^6.0.0", |     "babel-core": "^6.0.0", | ||||||
|     "babel-loader": "^6.2.10", |     "babel-loader": "^6.2.10", | ||||||
|     "babel-preset-es2015": "^6.0.0", |     "babel-preset-env": "latest", | ||||||
|     "babel-preset-latest": "^6.0.0", |  | ||||||
|     "babel-preset-stage-2": "^6.24.1", |  | ||||||
|     "cross-env": "^3.0.0", |     "cross-env": "^3.0.0", | ||||||
|     "css-loader": "^0.25.0", |     "css-loader": "^0.25.0", | ||||||
|     "file-loader": "^0.9.0", |     "file-loader": "^0.9.0", | ||||||
|   | |||||||
| @@ -10,17 +10,12 @@ module.exports = { | |||||||
|     library:'VueJsModal', |     library:'VueJsModal', | ||||||
|     libraryTarget: 'umd' |     libraryTarget: 'umd' | ||||||
|   }, |   }, | ||||||
|  |   target: 'node', | ||||||
|   module: { |   module: { | ||||||
|     rules: [ |     rules: [ | ||||||
|       { |       { | ||||||
|         test: /\.vue$/, |         test: /\.vue$/, | ||||||
|         loader: 'vue-loader', |         loader: 'vue-loader' | ||||||
|         options: { |  | ||||||
|           loaders: { |  | ||||||
|             'scss': 'vue-style-loader!css-loader!sass-loader', |  | ||||||
|             'sass': 'vue-style-loader!css-loader!sass-loader?indentedSyntax' |  | ||||||
|           } |  | ||||||
|         } |  | ||||||
|       }, |       }, | ||||||
|       { |       { | ||||||
|         test: /\.js$/, |         test: /\.js$/, | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user