mirror of
https://gitee.com/mirrors/AllinSSL.git
synced 2026-04-07 03:03:15 +08:00
【初始化】前端工程项目
This commit is contained in:
37
frontend/packages/pinia/vite.config.ts
Normal file
37
frontend/packages/pinia/vite.config.ts
Normal file
@@ -0,0 +1,37 @@
|
||||
import { defineConfig } from 'vite'
|
||||
import { resolve } from 'path'
|
||||
import dts from 'vite-plugin-dts'
|
||||
|
||||
export default defineConfig({
|
||||
plugins: [
|
||||
dts({
|
||||
include: ['*.ts'],
|
||||
beforeWriteFile: (filePath, content) => ({
|
||||
filePath: filePath.replace(/src/, ''),
|
||||
content,
|
||||
}),
|
||||
}),
|
||||
],
|
||||
build: {
|
||||
outDir: resolve(__dirname, 'dist'),
|
||||
emptyOutDir: true,
|
||||
lib: {
|
||||
entry: {
|
||||
index: resolve(__dirname, 'src/index.ts'),
|
||||
utils: resolve(__dirname, 'src/utils.ts'),
|
||||
},
|
||||
name: 'BaotaPinia',
|
||||
formats: ['es', 'cjs'],
|
||||
fileName: (format, entryName) => `${entryName}.${format === 'es' ? 'mjs' : 'cjs'}`,
|
||||
},
|
||||
rollupOptions: {
|
||||
external: ['pinia', 'pinia-plugin-persistedstate'],
|
||||
output: {
|
||||
globals: {
|
||||
pinia: 'Pinia',
|
||||
'pinia-plugin-persistedstate': 'piniaPluginPersistedstate',
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
Reference in New Issue
Block a user