-
-
- 质量
+
+ 压缩质量
-
+
-
- 压缩
- {{ options.quality }}%
- 原图
-
+
+ {{ Math.round(quality * 100) }}%
+
-
+
@@ -152,127 +134,110 @@
\ No newline at end of file
diff --git a/tsconfig.app.json b/tsconfig.app.json
new file mode 100644
index 0000000..6c06315
--- /dev/null
+++ b/tsconfig.app.json
@@ -0,0 +1,12 @@
+{
+ "extends": "@vue/tsconfig/tsconfig.dom.json",
+ "include": ["env.d.ts", "src/**/*", "src/**/*.vue"],
+ "exclude": ["src/**/__tests__/*"],
+ "compilerOptions": {
+ "composite": true,
+ "baseUrl": ".",
+ "paths": {
+ "@/*": ["./src/*"]
+ }
+ }
+}
\ No newline at end of file
diff --git a/tsconfig.json b/tsconfig.json
index bd20517..0dd2651 100644
--- a/tsconfig.json
+++ b/tsconfig.json
@@ -1,28 +1,11 @@
{
- "extends": "@vue/tsconfig/tsconfig.dom.json",
- "include": ["env.d.ts", "src/**/*", "src/**/*.vue"],
- "exclude": ["src/**/__tests__/*"],
- "compilerOptions": {
- "composite": true,
- "baseUrl": ".",
- "paths": {
- "@/*": ["./src/*"]
+ "files": [],
+ "references": [
+ {
+ "path": "./tsconfig.node.json"
},
- "types": ["vite/client", "node"],
- "target": "ESNext",
- "useDefineForClassFields": true,
- "module": "ESNext",
- "moduleResolution": "Node",
- "strict": true,
- "jsx": "preserve",
- "resolveJsonModule": true,
- "isolatedModules": true,
- "esModuleInterop": true,
- "lib": ["ESNext", "DOM"],
- "skipLibCheck": true,
- "noEmit": true,
- "allowJs": true,
- "checkJs": false,
- "allowSyntheticDefaultImports": true
- }
+ {
+ "path": "./tsconfig.app.json"
+ }
+ ]
}
\ No newline at end of file
diff --git a/tsconfig.node.json b/tsconfig.node.json
new file mode 100644
index 0000000..fbc87ec
--- /dev/null
+++ b/tsconfig.node.json
@@ -0,0 +1,10 @@
+{
+ "extends": "@tsconfig/node18/tsconfig.json",
+ "include": ["vite.config.*", "vitest.config.*", "cypress.config.*", "playwright.config.*"],
+ "compilerOptions": {
+ "composite": true,
+ "module": "ESNext",
+ "moduleResolution": "Bundler",
+ "types": ["node"]
+ }
+}
\ No newline at end of file
diff --git a/vite.config.ts b/vite.config.ts
index 8625cec..df32b46 100644
--- a/vite.config.ts
+++ b/vite.config.ts
@@ -1,13 +1,15 @@
+import { fileURLToPath, URL } from 'node:url'
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import { resolve } from 'path'
// https://vitejs.dev/config/
export default defineConfig({
+ base: '/image-optimizer/',
plugins: [vue()],
resolve: {
alias: {
- '@': resolve(__dirname, 'src'),
+ '@': fileURLToPath(new URL('./src', import.meta.url))
},
},
server: {
@@ -21,10 +23,9 @@ export default defineConfig({
rollupOptions: {
output: {
manualChunks: {
- 'vue-vendor': ['vue', 'vue-router', 'pinia', 'vue-i18n'],
- 'ui-vendor': ['tailwindcss'],
- },
- },
+ 'vue-vendor': ['vue', 'vue-router']
+ }
+ }
},
},
})
\ No newline at end of file