fix(deps)!: update Vite to v7 and remove cjs build

This commit is contained in:
alex8088 2025-06-28 13:08:38 +08:00
parent 4071778f07
commit 48e6f4f570
5 changed files with 21 additions and 32 deletions

View File

@ -24,7 +24,7 @@ if (debugIndex > 0) {
}
function run() {
import('../dist/cli.mjs')
import('../dist/cli.js')
}
run()

View File

@ -3,15 +3,10 @@
"version": "3.1.0",
"description": "Electron build tooling based on Vite",
"type": "module",
"main": "dist/index.cjs",
"module": "dist/index.mjs",
"types": "dist/index.d.ts",
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
"exports": {
".": {
"types": "./dist/index.d.ts",
"import": "./dist/index.mjs",
"require": "./dist/index.cjs"
},
".": "./dist/index.js",
"./node": {
"types": "./node.d.ts"
},
@ -66,7 +61,7 @@
},
"peerDependencies": {
"@swc/core": "^1.0.0",
"vite": "^4.0.0 || ^5.0.0 || ^6.0.0"
"vite": "^5.0.0 || ^6.0.0 || ^7.0.0"
},
"peerDependenciesMeta": {
"@swc/core": {
@ -93,7 +88,7 @@
"tslib": "^2.8.1",
"typescript": "^5.8.3",
"typescript-eslint": "^8.35.0",
"vite": "^6.3.5"
"vite": "^7.0.0"
},
"dependencies": {
"@babel/core": "^7.27.7",

24
pnpm-lock.yaml generated
View File

@ -85,8 +85,8 @@ importers:
specifier: ^8.35.0
version: 8.35.0(eslint@9.29.0)(typescript@5.8.3)
vite:
specifier: ^6.3.5
version: 6.3.5(@types/node@22.15.33)(yaml@2.8.0)
specifier: ^7.0.0
version: 7.0.0(@types/node@22.15.33)(yaml@2.8.0)
packages:
@ -1367,19 +1367,19 @@ packages:
uri-js@4.4.1:
resolution: {integrity: sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==}
vite@6.3.5:
resolution: {integrity: sha512-cZn6NDFE7wdTpINgs++ZJ4N49W2vRp8LCKrn3Ob1kYNtOo21vfDoaV5GzBfLU4MovSAB8uNRm4jgzVQZ+mBzPQ==}
engines: {node: ^18.0.0 || ^20.0.0 || >=22.0.0}
vite@7.0.0:
resolution: {integrity: sha512-ixXJB1YRgDIw2OszKQS9WxGHKwLdCsbQNkpJN171udl6szi/rIySHL6/Os3s2+oE4P/FLD4dxg4mD7Wust+u5g==}
engines: {node: ^20.19.0 || >=22.12.0}
hasBin: true
peerDependencies:
'@types/node': ^18.0.0 || ^20.0.0 || >=22.0.0
'@types/node': ^20.19.0 || >=22.12.0
jiti: '>=1.21.0'
less: '*'
less: ^4.0.0
lightningcss: ^1.21.0
sass: '*'
sass-embedded: '*'
stylus: '*'
sugarss: '*'
sass: ^1.70.0
sass-embedded: ^1.70.0
stylus: '>=0.54.8'
sugarss: ^5.0.0
terser: ^5.16.0
tsx: ^4.8.1
yaml: ^2.4.2
@ -2596,7 +2596,7 @@ snapshots:
dependencies:
punycode: 2.3.1
vite@6.3.5(@types/node@22.15.33)(yaml@2.8.0):
vite@7.0.0(@types/node@22.15.33)(yaml@2.8.0):
dependencies:
esbuild: 0.25.5
fdir: 6.4.6(picomatch@4.0.2)

View File

@ -17,14 +17,8 @@ export default defineConfig([
output: [
{
dir: 'dist',
entryFileNames: '[name].cjs',
chunkFileNames: 'chunks/lib-[hash].cjs',
format: 'cjs'
},
{
dir: 'dist',
entryFileNames: '[name].mjs',
chunkFileNames: 'chunks/lib-[hash].mjs',
entryFileNames: '[name].js',
chunkFileNames: 'chunks/lib-[hash].js',
format: 'es'
}
],

View File

@ -1,4 +1,4 @@
export { type LogLevel, createLogger, mergeConfig, splitVendorChunkPlugin, splitVendorChunk } from 'vite'
export { type LogLevel, createLogger, mergeConfig } from 'vite'
export * from './config'
export { createServer } from './server'
export { build } from './build'