-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
137 additions
and
147 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +1,41 @@ | ||
import { defineConfig } from 'vite' | ||
import Dts from 'vite-plugin-dts' | ||
|
||
export default defineConfig({ | ||
plugins: [ | ||
{ | ||
name: 'replace dev flag', | ||
enforce: 'pre', | ||
transform: { | ||
order: 'pre', | ||
handler(code, id) { | ||
if (id.endsWith('.ts')) | ||
return code.replaceAll(`__DEV__`, `!!(process.env.NODE_ENV !== "production")`) | ||
}, | ||
}, | ||
}, | ||
Dts({ | ||
include: [ | ||
'./src/**/*.ts', | ||
'./tsconfig.json', | ||
'./shim.d.ts', | ||
], | ||
rollupTypes: true, | ||
beforeWriteFile(_, content) { | ||
return { | ||
content: content.replaceAll('\'@vue/reactivity\'', '\'@reactive-vscode/reactivity\''), | ||
} | ||
}, | ||
}), | ||
], | ||
build: { | ||
lib: { | ||
entry: 'src/index.ts', | ||
formats: ['es'], | ||
fileName: 'index', | ||
}, | ||
rollupOptions: { | ||
external: ['vscode', '@reactive-vscode/reactivity'], | ||
}, | ||
}, | ||
}) | ||
import { defineConfig } from 'vite' | ||
import Dts from 'vite-plugin-dts' | ||
|
||
export default defineConfig({ | ||
plugins: [ | ||
{ | ||
name: 'replace dev flag', | ||
enforce: 'pre', | ||
transform: { | ||
order: 'pre', | ||
handler(code, id) { | ||
if (id.endsWith('.ts')) | ||
return code.replaceAll(`__DEV__`, `!!(process.env.NODE_ENV !== "production")`) | ||
}, | ||
}, | ||
}, | ||
Dts({ | ||
include: [ | ||
'./src/**/*.ts', | ||
'./tsconfig.json', | ||
'./shim.d.ts', | ||
], | ||
rollupTypes: true, | ||
beforeWriteFile(_, content) { | ||
return { | ||
content: content.replaceAll('\'@vue/reactivity\'', '\'@reactive-vscode/reactivity\''), | ||
} | ||
}, | ||
}), | ||
], | ||
build: { | ||
lib: { | ||
entry: 'src/index.ts', | ||
formats: ['es', 'cjs'], | ||
fileName: 'index', | ||
}, | ||
rollupOptions: { | ||
external: ['vscode', '@reactive-vscode/reactivity'], | ||
}, | ||
}, | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,35 @@ | ||
import path from 'node:path' | ||
import { defineConfig } from 'vite' | ||
import Dts from 'vite-plugin-dts' | ||
|
||
export default defineConfig({ | ||
plugins: [ | ||
{ | ||
name: 'replace dev flag', | ||
enforce: 'pre', | ||
transform: { | ||
order: 'pre', | ||
handler(code, id) { | ||
if (id.endsWith('.ts')) | ||
return code.replaceAll(`__DEV__`, `!!(process.env.NODE_ENV !== "production")`) | ||
}, | ||
}, | ||
}, | ||
Dts({ | ||
include: [ | ||
'./src/**/*.ts', | ||
'./tsconfig.json', | ||
'./shim.d.ts', | ||
], | ||
rollupTypes: true, | ||
bundledPackages: ['@vue/reactivity', '@vue/shared'], | ||
}), | ||
], | ||
build: { | ||
lib: { | ||
entry: 'src/index.ts', | ||
formats: ['es'], | ||
fileName: 'index', | ||
}, | ||
minify: false, | ||
}, | ||
}) | ||
import { defineConfig } from 'vite' | ||
import Dts from 'vite-plugin-dts' | ||
|
||
export default defineConfig({ | ||
plugins: [ | ||
{ | ||
name: 'replace dev flag', | ||
enforce: 'pre', | ||
transform: { | ||
order: 'pre', | ||
handler(code, id) { | ||
if (id.endsWith('.ts')) | ||
return code.replaceAll(`__DEV__`, `!!(process.env.NODE_ENV !== "production")`) | ||
}, | ||
}, | ||
}, | ||
Dts({ | ||
include: [ | ||
'./src/**/*.ts', | ||
'./tsconfig.json', | ||
'./shim.d.ts', | ||
], | ||
rollupTypes: true, | ||
bundledPackages: ['@vue/reactivity', '@vue/shared'], | ||
}), | ||
], | ||
build: { | ||
lib: { | ||
entry: 'src/index.ts', | ||
formats: ['es', 'cjs'], | ||
fileName: 'index', | ||
}, | ||
minify: false, | ||
}, | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,52 +1,52 @@ | ||
import path from 'node:path' | ||
import { defineConfig } from 'vite' | ||
import Dts from 'vite-plugin-dts' | ||
|
||
export default defineConfig({ | ||
plugins: [ | ||
{ | ||
name: 'replace constants', | ||
enforce: 'pre', | ||
transform: { | ||
order: 'pre', | ||
handler(code, id) { | ||
if (id.endsWith('.mjs')) { | ||
return code | ||
.replaceAll(`getCurrentInstance()`, `null`) | ||
.replaceAll(`getLifeCycleTarget()`, `null`) | ||
} | ||
}, | ||
}, | ||
}, | ||
Dts({ | ||
include: [ | ||
'./src/**/*.ts', | ||
'./tsconfig.json', | ||
'./shim.d.ts', | ||
], | ||
rollupTypes: true, | ||
bundledPackages: ['@vueuse/core', '@vueuse/shared'], | ||
beforeWriteFile(_, content) { | ||
return { | ||
content: content.replaceAll('\'vue-demi\'', '\'@reactive-vscode/reactivity\''), | ||
} | ||
}, | ||
}), | ||
], | ||
resolve: { | ||
alias: { | ||
'vue-demi': path.resolve(__dirname, './src/vue-demi.ts'), | ||
}, | ||
}, | ||
build: { | ||
lib: { | ||
entry: 'src/index.ts', | ||
formats: ['es'], | ||
fileName: 'index', | ||
}, | ||
rollupOptions: { | ||
external: ['@reactive-vscode/reactivity'], | ||
}, | ||
minify: false, | ||
}, | ||
}) | ||
import path from 'node:path' | ||
import { defineConfig } from 'vite' | ||
import Dts from 'vite-plugin-dts' | ||
|
||
export default defineConfig({ | ||
plugins: [ | ||
{ | ||
name: 'replace constants', | ||
enforce: 'pre', | ||
transform: { | ||
order: 'pre', | ||
handler(code, id) { | ||
if (id.endsWith('.mjs')) { | ||
return code | ||
.replaceAll(`getCurrentInstance()`, `null`) | ||
.replaceAll(`getLifeCycleTarget()`, `null`) | ||
} | ||
}, | ||
}, | ||
}, | ||
Dts({ | ||
include: [ | ||
'./src/**/*.ts', | ||
'./tsconfig.json', | ||
'./shim.d.ts', | ||
], | ||
rollupTypes: true, | ||
bundledPackages: ['@vueuse/core', '@vueuse/shared'], | ||
beforeWriteFile(_, content) { | ||
return { | ||
content: content.replaceAll('\'vue-demi\'', '\'@reactive-vscode/reactivity\''), | ||
} | ||
}, | ||
}), | ||
], | ||
resolve: { | ||
alias: { | ||
'vue-demi': path.resolve(__dirname, './src/vue-demi.ts'), | ||
}, | ||
}, | ||
build: { | ||
lib: { | ||
entry: 'src/index.ts', | ||
formats: ['es', 'cjs'], | ||
fileName: 'index', | ||
}, | ||
rollupOptions: { | ||
external: ['@reactive-vscode/reactivity'], | ||
}, | ||
minify: false, | ||
}, | ||
}) |