mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-06 03:57:59 +08:00
chore(cli): set node env
This commit is contained in:
parent
9318e6b909
commit
6f1b24663e
@ -1,8 +1,9 @@
|
||||
import { runCLI } from 'jest';
|
||||
import { setNodeEnv } from '../common';
|
||||
import { CWD, JEST_CONFIG_FILE } from '../common/constant';
|
||||
|
||||
export function test(command: any) {
|
||||
process.env.NODE_ENV = 'test';
|
||||
setNodeEnv('test');
|
||||
|
||||
const config = {
|
||||
rootDir: CWD,
|
||||
|
@ -88,11 +88,14 @@ export function getWebpackConfig(): object {
|
||||
return {};
|
||||
}
|
||||
|
||||
export function setModuleEnv(value: 'esmodule' | 'commonjs') {
|
||||
export type ModuleEnv = 'esmodule' | 'commonjs';
|
||||
export type NodeEnv = 'production' | 'development' | 'test';
|
||||
|
||||
export function setModuleEnv(value: ModuleEnv) {
|
||||
process.env.BABEL_MODULE = value;
|
||||
}
|
||||
|
||||
export function setNodeEnv(value: 'production' | 'development') {
|
||||
export function setNodeEnv(value: NodeEnv) {
|
||||
process.env.NODE_ENV = value;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user