mirror of
https://gitee.com/qqtt-ah/ecom-dmb.git
synced 2026-11-24 06:29:20 +08:00
34 lines
794 B
TypeScript
34 lines
794 B
TypeScript
import { resolve } from 'node:path';
|
|
import { defineConfig } from 'vite';
|
|
import vue from '@vitejs/plugin-vue';
|
|
|
|
/** 功能脚本独立构建 → artifacts/features/(部署到后端静态目录) */
|
|
export default defineConfig({
|
|
plugins: [vue()],
|
|
resolve: {
|
|
alias: {
|
|
'@': resolve(__dirname, 'src'),
|
|
},
|
|
},
|
|
define: {
|
|
'process.env.NODE_ENV': JSON.stringify('production'),
|
|
},
|
|
build: {
|
|
outDir: 'artifacts/features',
|
|
emptyOutDir: true,
|
|
lib: {
|
|
entry: resolve(__dirname, 'src/features/pdd-ad-fee/index.ts'),
|
|
name: 'EcbiFeaturePddAdFee',
|
|
formats: ['iife'],
|
|
fileName: () => 'pdd-ad-fee.js',
|
|
},
|
|
rollupOptions: {
|
|
output: {
|
|
inlineDynamicImports: true,
|
|
},
|
|
},
|
|
sourcemap: true,
|
|
minify: true,
|
|
},
|
|
});
|