@expo/xdl
Version:
The Expo Development Library
73 lines (52 loc) • 2.11 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.isDebugModeEnabled = isDebugModeEnabled;
exports.isInfoEnabled = isInfoEnabled;
exports.shouldWebpackClearLogs = shouldWebpackClearLogs;
exports.logEnvironmentInfo = logEnvironmentInfo;
exports.DEFAULT_PORT = exports.HOST = void 0;
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 _ProjectUtils() {
const data = require("../project/ProjectUtils");
_ProjectUtils = 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') {
(0, _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=../__sourcemaps__/webpack-utils/WebpackEnvironment.js.map