vue-template-babel-compiler
Advanced tools
Comparing version 1.0.0 to 1.0.1
@@ -18,2 +18,20 @@ 'use strict'; | ||
function inScope(scope, nodeName) { | ||
if (!scope || !scope.bindings) return false; | ||
let ret = false; | ||
let cur = scope; | ||
while (cur) { | ||
ret = cur.bindings[nodeName]; | ||
if (cur === scope.parent || ret) { | ||
break; | ||
} | ||
cur = scope.parent; | ||
} | ||
return ret; | ||
} | ||
function shouldPrependVmNew(path) { | ||
@@ -38,3 +56,3 @@ var _scope$path, _scope$block$params; | ||
&& !(scope !== null && scope !== void 0 && (_scope$block$params = scope.block.params) !== null && _scope$block$params !== void 0 && _scope$block$params.find(node => node.name === nodeName)) // not already in scope | ||
&& !scope.bindings[nodeName]) { | ||
&& !inScope(scope, nodeName)) { | ||
return true; | ||
@@ -41,0 +59,0 @@ } |
{ | ||
"name": "vue-template-babel-compiler", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "Post compiler for Vue template render functions to support ES features with Babel", | ||
@@ -18,3 +18,3 @@ "main": "lib/index.js", | ||
"test": " npm run build && jest", | ||
"inspect": "npm run build && node --inspect-brk ./node_modules/jest/bin/jest.js", | ||
"inspect": "npm run build && node --inspect-brk ./node_modules/jest/bin/jest.js --runInBand", | ||
"prepublishOnly": "jest && npm run build" | ||
@@ -21,0 +21,0 @@ }, |
@@ -28,7 +28,8 @@ # vue-template-babel-compiler | ||
``` bash | ||
npm install --save-dev vue-template-babel-compiler | ||
npm install vue-template-babel-compiler --save-dev | ||
``` | ||
### 2. Config | ||
#### 1. [vue-cli](https://cli.vuejs.org/guide/webpack.html#modifying-options-of-a-loader) | ||
#### 1. [Vue-CLI](https://cli.vuejs.org/guide/webpack.html#modifying-options-of-a-loader) | ||
[DEMO project for Vue-CLI](https://github.com/JuniorTour/vue-template-babel-compiler-vue-cli-project) | ||
``` js | ||
@@ -49,13 +50,38 @@ // vue.config.js | ||
#### 2. [nuxt.js](https://nuxtjs.org/docs/2.x/features/configuration#extend-webpack-to-load-audio-files) | ||
#### 2. [Nuxt.js](https://nuxtjs.org/docs/2.x/features/configuration#extend-webpack-to-load-audio-files) | ||
[DEMO project for Nuxt.js](https://github.com/JuniorTour/vue-template-babel-compiler-nuxt-project) | ||
``` js | ||
// nuxt.config.js | ||
export default { | ||
// Build Configuration: https://go.nuxtjs.dev/config-build | ||
build: { | ||
loaders: { | ||
vue: { | ||
compiler: require('vue-template-babel-compiler') | ||
} | ||
}, | ||
}, | ||
// ... | ||
} | ||
``` | ||
#### 3. [webpack](https://cli.vuejs.org/guide/webpack.html#modifying-options-of-a-loader) | ||
#### 3. [Webpack](https://cli.vuejs.org/guide/webpack.html#modifying-options-of-a-loader) | ||
``` js | ||
// your webpack.config.js which config vue-loader | ||
// your webpack.config.js where config vue-loader | ||
module.exports = { | ||
// ... | ||
module: { | ||
rules: [ | ||
{ | ||
test: /\.vue$/, | ||
loader: 'vue-loader', | ||
options: { | ||
compiler: require('vue-template-babel-compiler') | ||
} | ||
} | ||
] | ||
} | ||
} | ||
``` | ||
### Welcome for Issues && PR. |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
11274
153
86