Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
if (typeof userModules === 'string') {
userModules = require(userModules)
}
const compilerOptions = {
preserveWhitespace: options.preserveWhitespace,
modules: defaultModules.concat(userModules || []),
directives:
vueOptions.compilerDirectives || options.compilerDirectives || {},
scopeId: options.hasScoped ? options.id : null,
comments: options.hasComment
}
const compile =
isServer && compiler.ssrCompile && vueOptions.optimizeSSR !== false
? compiler.ssrCompile
: compiler.compile
const compiled = compile(html, compilerOptions)
// tips
if (compiled.tips && compiled.tips.length) {
compiled.tips.forEach(tip => {
this.emitWarning(tip)
})
}
let code
if (compiled.errors && compiled.errors.length) {
this.emitError(
`\n Error compiling template:\n${pad(html)}\n` +
compiled.errors.map(e => ` - ${e}`).join('\n') +
//@ts-ignore
import * as compiler from "vue-template-compiler";
import { parseComponent as _parseComponent } from "./new-parse-component"
export const parseComponent = _parseComponent;
// export const parseComponent = _parseComponent
export const compile = compiler.compile;
export const compileToFunctions = compiler.compileToFunctions;
export const ssrCompile = compiler.ssrCompile;
export const ssrCompileToFunctions = compiler.ssrCompileToFunctions;
// for HappyPack cross-process use cases
if (typeof userModules === 'string') {
userModules = require(userModules)
}
const compilerOptions = {
preserveWhitespace: options.preserveWhitespace,
modules: defaultModules.concat(userModules || []),
directives:
vueOptions.compilerDirectives || options.compilerDirectives || {},
scopeId: options.hasScoped ? options.id : null,
comments: options.hasComment
}
const compile =
isServer && compiler.ssrCompile && vueOptions.optimizeSSR !== false
? compiler.ssrCompile
: compiler.compile
const compiled = compile(html, compilerOptions)
// tips
if (compiled.tips && compiled.tips.length) {
compiled.tips.forEach(tip => {
this.emitWarning(tip)
})
}
let code
if (compiled.errors && compiled.errors.length) {
this.emitError(
`\n Error compiling template:\n${pad(html)}\n` +