2019-11-09 12:56:11 +00:00
|
|
|
import * as Path from 'path';
|
|
|
|
|
|
|
|
const projectRoot = Path.dirname(__dirname);
|
|
|
|
const channel = process.env.NODE_ENV;
|
|
|
|
|
|
|
|
const s = JSON.stringify;
|
|
|
|
|
|
|
|
export function getEnviroments() {
|
|
|
|
return {
|
|
|
|
__DARWIN__: process.platform === 'darwin',
|
|
|
|
__WIN32__: process.platform === 'win32',
|
|
|
|
__LINUX__: process.platform === 'linux',
|
|
|
|
__DEV__: channel === 'development',
|
|
|
|
'process.platform': s(process.platform),
|
|
|
|
'process.env.NODE_ENV': s(process.env.NODE_ENV || 'development'),
|
2019-11-28 21:45:47 +00:00
|
|
|
'process.env.TEST_ENV': s(process.env.TEST_ENV),
|
2019-11-09 12:56:11 +00:00
|
|
|
};
|
|
|
|
}
|