vue-inbrowser-compiler
Advanced tools
Comparing version 4.71.1 to 4.72.0
# Change Log | ||
## 4.72.0 | ||
### Minor Changes | ||
- [`c972cff3`](https://github.com/vue-styleguidist/vue-styleguidist/commit/c972cff356257b0162a10f8857f33d75dff639c8) Thanks [@elevatebart](https://github.com/elevatebart)! - build compiler using the updated utils | ||
## 4.71.1 | ||
@@ -4,0 +10,0 @@ |
@@ -19,3 +19,3 @@ import { TransformOptions } from 'buble'; | ||
*/ | ||
export default function compileVueCodeForEvalFunction(code: string, config?: TransformOptions): EvaluableComponentWithSource; | ||
export default function compileVueCodeForEvalFunction(code: string, config?: TransformOptions, scopeId?: string): EvaluableComponentWithSource; | ||
export {}; |
@@ -225,6 +225,6 @@ 'use strict'; | ||
*/ | ||
function compileVueCodeForEvalFunction(code, config = {}) { | ||
function compileVueCodeForEvalFunction(code, config = {}, scopeId) { | ||
const nonCompiledComponent = prepareVueCodeForEvalFunction(code, config); | ||
const target = typeof window !== 'undefined' ? getTargetFromBrowser() : {}; | ||
const compiledComponent = Object.assign(Object.assign({}, nonCompiledComponent), { script: buble.transform(nonCompiledComponent.script, Object.assign({ target }, config)).code }); | ||
const compiledComponent = Object.assign(Object.assign({}, nonCompiledComponent), { scopeId, script: buble.transform(nonCompiledComponent.script, Object.assign({ target }, config)).code }); | ||
vueInbrowserCompilerUtils.compileTemplateForEval(compiledComponent); | ||
@@ -231,0 +231,0 @@ if (nonCompiledComponent.setup && vueInbrowserCompilerUtils.isVue3) { |
@@ -217,6 +217,6 @@ import { isVue3, parseComponent, transformOneImport, compileTemplateForEval, compileTemplateForEvalSetup, isCodeVueSfc } from 'vue-inbrowser-compiler-utils'; | ||
*/ | ||
function compileVueCodeForEvalFunction(code, config = {}) { | ||
function compileVueCodeForEvalFunction(code, config = {}, scopeId) { | ||
const nonCompiledComponent = prepareVueCodeForEvalFunction(code, config); | ||
const target = typeof window !== 'undefined' ? getTargetFromBrowser() : {}; | ||
const compiledComponent = Object.assign(Object.assign({}, nonCompiledComponent), { script: transform(nonCompiledComponent.script, Object.assign({ target }, config)).code }); | ||
const compiledComponent = Object.assign(Object.assign({}, nonCompiledComponent), { scopeId, script: transform(nonCompiledComponent.script, Object.assign({ target }, config)).code }); | ||
compileTemplateForEval(compiledComponent); | ||
@@ -223,0 +223,0 @@ if (nonCompiledComponent.setup && isVue3) { |
{ | ||
"name": "vue-inbrowser-compiler", | ||
"version": "4.71.1", | ||
"version": "4.72.0", | ||
"description": "compile vue single file components right in your browser", | ||
@@ -5,0 +5,0 @@ "module": "lib/vue-inbrowser-compiler.esm.js", |
@@ -39,3 +39,4 @@ import { transform, TransformOptions } from 'buble' | ||
code: string, | ||
config: TransformOptions = {} | ||
config: TransformOptions = {}, | ||
scopeId?: string | ||
): EvaluableComponentWithSource { | ||
@@ -47,2 +48,3 @@ const nonCompiledComponent = prepareVueCodeForEvalFunction(code, config) | ||
...nonCompiledComponent, | ||
scopeId, | ||
script: transform(nonCompiledComponent.script, { target, ...config }).code | ||
@@ -49,0 +51,0 @@ } |
Sorry, the diff of this file is not supported yet
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
87026
27
1893