- Notifications
You must be signed in to change notification settings - Fork 71
/
Copy pathpostinstall.cjs
21 lines (14 loc) · 648 Bytes
/
postinstall.cjs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
constfs=require('fs')
const{ switchVersion, loadModule }=require('./utils.cjs')
constVue=loadModule('vue')
if(fs.existsSync('.local'))
console.log('Currently, it is the local development environment, not doing anything.')
elseif(!Vue||typeofVue.version!=='string')
console.warn('[v-code-diff] Vue is not found. Please run "npm install vue" to install.')
elseif(Vue.version.startsWith('2.7.'))
switchVersion('2.7')
elseif(Vue.version.startsWith('2.'))
switchVersion('2')
elseif(Vue.version.startsWith('3.'))
switchVersion('3')
elseconsole.warn(`[v-code-diff] Vue version v${Vue.version} is not suppported.`)