chore: update vite 8
This commit is contained in:
@@ -51,6 +51,7 @@
|
||||
"rollup": "catalog:",
|
||||
"rollup-plugin-visualizer": "catalog:",
|
||||
"sass": "catalog:",
|
||||
"sass-embedded": "catalog:",
|
||||
"vite": "catalog:",
|
||||
"vite-plugin-compression": "catalog:",
|
||||
"vite-plugin-dts": "catalog:",
|
||||
|
||||
@@ -6,7 +6,7 @@ import path, { relative } from 'node:path';
|
||||
|
||||
import { findMonorepoRoot } from '@vben/node-utils';
|
||||
|
||||
import { NodePackageImporter } from 'sass';
|
||||
import { NodePackageImporter } from 'sass-embedded';
|
||||
import { defineConfig, loadEnv, mergeConfig } from 'vite';
|
||||
|
||||
import { defaultImportmapOptions, getDefaultPwaOptions } from '../options';
|
||||
@@ -58,25 +58,23 @@ function defineApplicationConfig(userConfigPromise?: DefineApplicationOptions) {
|
||||
const applicationConfig: UserConfig = {
|
||||
base,
|
||||
build: {
|
||||
rollupOptions: {
|
||||
rolldownOptions: {
|
||||
output: {
|
||||
assetFileNames: '[ext]/[name]-[hash].[ext]',
|
||||
chunkFileNames: 'js/[name]-[hash].js',
|
||||
entryFileNames: 'jse/index-[name]-[hash].js',
|
||||
minify: isBuild
|
||||
? {
|
||||
compress: {
|
||||
dropDebugger: true,
|
||||
},
|
||||
}
|
||||
: false,
|
||||
},
|
||||
},
|
||||
target: 'es2015',
|
||||
},
|
||||
css: createCssOptions(injectGlobalScss),
|
||||
esbuild: {
|
||||
drop: isBuild
|
||||
? [
|
||||
// 'console',
|
||||
'debugger',
|
||||
]
|
||||
: [],
|
||||
legalComments: 'none',
|
||||
},
|
||||
plugins,
|
||||
server: {
|
||||
host: true,
|
||||
|
||||
@@ -40,7 +40,7 @@ function defineLibraryConfig(userConfigPromise?: DefineLibraryOptions) {
|
||||
fileName: () => 'index.mjs',
|
||||
formats: ['es'],
|
||||
},
|
||||
rollupOptions: {
|
||||
rolldownOptions: {
|
||||
external: (id) => {
|
||||
return externalPackages.some(
|
||||
(pkg) => id === pkg || id.startsWith(`${pkg}/`),
|
||||
|
||||
@@ -77,11 +77,13 @@ async function loadCommonPlugins(
|
||||
},
|
||||
{
|
||||
condition: isBuild && !!visualizer,
|
||||
plugins: () => [<PluginOption>viteVisualizerPlugin({
|
||||
plugins: () => [
|
||||
viteVisualizerPlugin({
|
||||
filename: './node_modules/.cache/visualizer/stats.html',
|
||||
gzipSize: true,
|
||||
open: true,
|
||||
})],
|
||||
}) as PluginOption,
|
||||
],
|
||||
},
|
||||
];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user