From d0fdd02585037c5fba31a0e3b27e22009c86268b Mon Sep 17 00:00:00 2001 From: euvl Date: Mon, 19 Jun 2017 22:20:46 +0100 Subject: [PATCH] Added "node" target to package.json, updated babelrc --- .babelrc | 2 +- dist/index.js | 258 +++++++++++----------------------------------- package.json | 4 +- webpack.config.js | 9 +- 4 files changed, 65 insertions(+), 208 deletions(-) diff --git a/.babelrc b/.babelrc index 2aa352e..e08e074 100644 --- a/.babelrc +++ b/.babelrc @@ -1,4 +1,4 @@ { - "presets": ["es2015", "stage-2"], + "presets": ["env"], "comments": false } diff --git a/dist/index.js b/dist/index.js index 9e8bd63..c830091 100644 --- a/dist/index.js +++ b/dist/index.js @@ -261,220 +261,84 @@ module.exports = function normalizeComponent ( /* 4 */ /***/ (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) -/* -type StyleObject = { - id: number; - parts: Array -} +module.exports = function (parentId, list, isProduction) { + if (typeof __VUE_SSR_CONTEXT__ !== 'undefined') { + var context = __VUE_SSR_CONTEXT__ + var styles = context._styles -type StyleObjectPart = { - 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 ' } + return css } @@ -1070,8 +934,8 @@ module.exports={render:function (){var _vm=this;var _h=_vm.$createElement;var _c var content = __webpack_require__(8); if(typeof content === 'string') content = [[module.i, content, '']]; if(content.locals) module.exports = content.locals; -// add the styles to the DOM -var update = __webpack_require__(4)("50c27c50", content, true); +// add CSS to SSR context +__webpack_require__(4)("50c27c50", content, true); /***/ }), /* 14 */ @@ -1083,8 +947,8 @@ var update = __webpack_require__(4)("50c27c50", content, true); var content = __webpack_require__(9); if(typeof content === 'string') content = [[module.i, content, '']]; if(content.locals) module.exports = content.locals; -// add the styles to the DOM -var update = __webpack_require__(4)("7054fa02", content, true); +// add CSS to SSR context +__webpack_require__(4)("7054fa02", content, true); /***/ }), /* 15 */ diff --git a/package.json b/package.json index 704c309..cc5907d 100644 --- a/package.json +++ b/package.json @@ -24,9 +24,7 @@ "devDependencies": { "babel-core": "^6.0.0", "babel-loader": "^6.2.10", - "babel-preset-es2015": "^6.0.0", - "babel-preset-latest": "^6.0.0", - "babel-preset-stage-2": "^6.24.1", + "babel-preset-env": "latest", "cross-env": "^3.0.0", "css-loader": "^0.25.0", "file-loader": "^0.9.0", diff --git a/webpack.config.js b/webpack.config.js index 669ce9b..f8871de 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -10,17 +10,12 @@ module.exports = { library:'VueJsModal', libraryTarget: 'umd' }, + target: 'node', module: { rules: [ { test: /\.vue$/, - loader: 'vue-loader', - options: { - loaders: { - 'scss': 'vue-style-loader!css-loader!sass-loader', - 'sass': 'vue-style-loader!css-loader!sass-loader?indentedSyntax' - } - } + loader: 'vue-loader' }, { test: /\.js$/,