You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

55 lines
2.0 KiB

"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.HOST = exports.DEFAULT_PORT = void 0;
exports.isDebugModeEnabled = isDebugModeEnabled;
exports.isInfoEnabled = isInfoEnabled;
exports.logEnvironmentInfo = logEnvironmentInfo;
exports.shouldWebpackClearLogs = shouldWebpackClearLogs;
function _chalk() {
const data = _interopRequireDefault(require("chalk"));
_chalk = function () {
return data;
};
return data;
}
function _getenv() {
const data = _interopRequireDefault(require("getenv"));
_getenv = function () {
return data;
};
return data;
}
function _internal() {
const data = require("../internal");
_internal = function () {
return data;
};
return data;
}
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
const HOST = _getenv().default.string('WEB_HOST', '0.0.0.0');
exports.HOST = HOST;
const DEFAULT_PORT = _getenv().default.int('WEB_PORT', 19006);
// When you have errors in the production build that aren't present in the development build you can use `EXPO_WEB_DEBUG=true expo start --no-dev` to debug those errors.
// - Prevent the production build from being minified
// - Include file path info comments in the bundle
exports.DEFAULT_PORT = DEFAULT_PORT;
function isDebugModeEnabled() {
return _getenv().default.boolish('EXPO_WEB_DEBUG', false);
}
function isInfoEnabled() {
return _getenv().default.boolish('EXPO_WEB_INFO', false);
}
function shouldWebpackClearLogs() {
return !isDebugModeEnabled() && !isInfoEnabled() && !_getenv().default.boolish('EXPO_DEBUG', false);
}
function logEnvironmentInfo(projectRoot, tag, config) {
if (isDebugModeEnabled() && config.mode === 'production') {
_internal().ProjectUtils.logWarning(projectRoot, tag, `Webpack is bundling your project in \`production\` mode with the ${_chalk().default.bold('`EXPO_WEB_DEBUG`')} environment variable enabled. You should toggle it off before building for production.`);
}
}
//# sourceMappingURL=WebpackEnvironment.js.map