| import { defineConfig } from '@umijs/max'; | import { defineConfig } from '@umijs/max'; | ||||
| import routes from './routes'; | import routes from './routes'; | ||||
| export default defineConfig({ | export default defineConfig({ | ||||
| dva: {}, | dva: {}, | ||||
| antd: {}, | antd: {}, | ||||
| access: { | access: { | ||||
| }, | }, | ||||
| model: {}, | model: {}, | ||||
| initialState: { | initialState: { | ||||
| name: '' | |||||
| }, | }, | ||||
| request: {}, | request: {}, | ||||
| layout: { | layout: { | ||||
| routes: routes, | routes: routes, | ||||
| hash: true, | hash: true, | ||||
| npmClient: 'npm', | npmClient: 'npm', | ||||
| chainWebpack: (memo, { webpack, env}) => { | |||||
| const {BUILD_ENV} = process.env; | |||||
| debugger | |||||
| }, | |||||
| }); | }); | ||||
| npm run build:env | |||||
| npm run build:development | |||||
| msg=$1 | msg=$1 | ||||
| ciskip="[CI SKIP]" | ciskip="[CI SKIP]" | ||||
| "private": true, | "private": true, | ||||
| "author": "Soleilw <a617759082@126.com>", | "author": "Soleilw <a617759082@126.com>", | ||||
| "scripts": { | "scripts": { | ||||
| "build": "cross-env UMI_ENV=prod max build", | |||||
| "build:env": "cross-env UMI_ENV=dev max build", | |||||
| "dev": "max dev", | |||||
| "build": "cross-env BUILD_ENV=production max build", | |||||
| "build:development": "cross-env BUILD_ENV=development max build", | |||||
| "dev": "cross-env BUILD_ENV=development max dev", | |||||
| "format": "prettier --cache --write .", | "format": "prettier --cache --write .", | ||||
| "postinstall": "max setup", | "postinstall": "max setup", | ||||
| "prepare": "husky", | "prepare": "husky", |
| export const isProduction = process.env.BUILD_ENV === 'production'; | |||||
| export const isDevelopment = process.env.BUILD_ENV === 'development'; | |||||
| console.log('process.env.BUILD_ENV', process.env.BUILD_ENV); | |||||
| export const Imageprefix = isProduction ? 'https://rcsc-test.jcjob.cn/img/' : 'https://admin1.jcjob.cn/img/'; |