| | |
| | | |
| | | import path from 'path'; |
| | | |
| | | import Config, from '../config/config'; |
| | | import Config from '../config/config'; |
| | | import { ConfigEnv } from 'vite'; |
| | | import * as hooks from '../src/hooks/global'; |
| | | import { configCompressPlugin } from './compress'; |
| | |
| | | type Options = { |
| | | VITE_LEGACY?: ViteEnv['VITE_LEGACY']; |
| | | VITE_COMPRESSION?: ViteEnv['VITE_COMPRESSION']; |
| | | VITE_WEMAP_KEY?: ViteEnv['VITE_WEMAP_KEY']; |
| | | VITE_AppType?: ViteEnv['VITE_AppType']; |
| | | }; |
| | | |
| | | export function getPluginsList(command: ConfigEnv['command'], options: Options = {}) { |
| | | const { VITE_LEGACY, VITE_COMPRESSION, VITE_AppType } = options; |
| | | const { VITE_LEGACY, VITE_COMPRESSION, VITE_WEMAP_KEY, VITE_AppType } = options; |
| | | // const prodMock = true; |
| | | const lifecycle = process.env.npm_lifecycle_event; |
| | | console.log(lifecycle, command); |
| | |
| | | data: { |
| | | title: Config.title, |
| | | subMenuIconCssPath: SubMenuManager.SubMenuIconCssPath, |
| | | WEMAP_KEY: VITE_WEMAP_KEY, |
| | | isJx: VITE_AppType === 'jx', |
| | | }, |
| | | }, |
| | | }), |