- 新增 `src/apis/index.ts` 文件,用于管理与塞壬唱片官网 API 的交互 - 在 `Home.vue` 中添加 API 调用逻辑,获取并打印专辑数据 - 更新 `vite.config.ts`,添加路径别名配置 - 在 `package.json` 中添加 `@types/node` 依赖 - 调整 `Playing.vue` 和 `App.vue` 的布局样式 - 更新 `manifest.json` 中的安全策略,允许连接到 API
35 lines
1007 B
TypeScript
35 lines
1007 B
TypeScript
import tailwindcss from '@tailwindcss/vite'
|
|
import vue from '@vitejs/plugin-vue'
|
|
import { defineConfig } from 'vite'
|
|
import path from "node:path"
|
|
|
|
// https://vite.dev/config/
|
|
export default defineConfig({
|
|
plugins: [vue(), tailwindcss()],
|
|
base: './', // Ensure relative paths work
|
|
build: {
|
|
outDir: 'dist',
|
|
rollupOptions: {
|
|
// Optional: configure input if you have multiple HTML files (e.g., options page)
|
|
// input: {
|
|
// popup: resolve(__dirname, 'index.html'),
|
|
// // options: resolve(__dirname, 'options.html'), // If you have an options page
|
|
// },
|
|
output: {
|
|
entryFileNames: 'assets/[name].js',
|
|
chunkFileNames: 'assets/[name].js',
|
|
assetFileNames: 'assets/[name].[ext]',
|
|
// Optional: to disable hashing for specific assets if needed
|
|
// entryFileNames: `assets/[name].js`,
|
|
// chunkFileNames: `assets/[name].js`,
|
|
// assetFileNames: `assets/[name].[ext]`
|
|
},
|
|
},
|
|
},
|
|
resolve: {
|
|
alias: {
|
|
"@": path.resolve(__dirname, "./src"),
|
|
},
|
|
}
|
|
})
|