Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export async function resolveVueTemplateCompiler(projectBasePath: string): Promise {
console.log('FINDING VUE TEMPLATE COMPILER')
const resolver: EnhancedResolver = ResolverFactory.createResolver({
fileSystem: fse
});
const instapackVueCompilerVersion: string = require('vue-template-compiler/package.json')['version'];
const vueVersion = await tryGetProjectPackageVersion(resolver, projectBasePath, 'vue');
try {
const vueCompilerVersion = await tryGetProjectPackageVersion(resolver, projectBasePath, 'vue-template-compiler');
if (!vueVersion || !vueCompilerVersion) {
throw new Error('Project Vue / Vue Template Compiler packages are not found.');
}
if (vueVersion !== vueCompilerVersion) {
Shout.warning(`Project vue (${vueVersion}) and vue-template-compiler (${vueCompilerVersion}) version mismatch!`
+ chalk.grey(`
Fix the project package.json and make sure to use the same version for both:
yarn add vue-template-compiler@${vueVersion} -D -E
OR
npm install vue-template-compiler@${vueVersion} -D -E
return __awaiter(this, void 0, void 0, function* () {
console.log('FINDING VUE TEMPLATE COMPILER');
const resolver = enhanced_resolve_1.ResolverFactory.createResolver({
fileSystem: fse
});
const instapackVueCompilerVersion = require('vue-template-compiler/package.json')['version'];
const vueVersion = yield tryGetProjectPackageVersion(resolver, projectBasePath, 'vue');
try {
const vueCompilerVersion = yield tryGetProjectPackageVersion(resolver, projectBasePath, 'vue-template-compiler');
if (!vueVersion || !vueCompilerVersion) {
throw new Error('Project Vue / Vue Template Compiler packages are not found.');
}
if (vueVersion !== vueCompilerVersion) {
Shout_1.Shout.warning(`Project vue (${vueVersion}) and vue-template-compiler (${vueCompilerVersion}) version mismatch!`
+ chalk.grey(`
Fix the project package.json and make sure to use the same version for both:
yarn add vue-template-compiler@${vueVersion} -D -E
OR
npm install vue-template-compiler@${vueVersion} -D -E
`));
Shout_1.Shout.warning('Fallback to instapack default built-in Vue Template Compiler...');
throw new Error('Project vue and vue-template-compiler version mismatched!');