d4b23d3ab4
* Clean up env files * Use new env in Sentry setup file * Use new env in Bitdrift setup file * Use new env in chat proxy header * Prefix Bitdrift key with EXPO_PUBLIC * Deprecate SENTRY_RELEASE since we use package.json now * Use existing EXPO_PUBLIC_BUNDLE_IDENTIFIER short commit has as Sentry dist value * Fix missing bundle identifier for Render deploys * Deprecate SENTRY_DIST in favor of EXPO_PUBLIC_BUNDLE_IDENTIFIER * Prefix SENTRY_DSN with EXPO_PUBLIC to match others * Remove debugging field * Replace NODE_ENV in places where its safe * Self review * Properly patch Sentry package * Echo variables to .env in Dockerfile instead of passing to shell script * Make sure EXPO_PUBLIC_ENV is set for web container builds * Update IS_TESTFLIGHT to include testflight-android * Slice bundle hash to match other platforms, needed for render.com deployments * [APP-1331] Migrate `app-info` to new env (#8703) * Move env files into directory with platform specific files * Migrate usages of app-info to new env * Fix bad import * Update BUNDLE_DATE format comment * Trim RENDER_GIT_COMMIT to first 7 to match --short sha * Clarify build process env vars and ensure they are explicitly passed in * Revert Sentry patch as a result of prev commit * Update webpack Sentry dist value based on prev commits * Add PACKAGE_VERSION and replace in statsig to fix conflict * Fix render substitution syntax * Remove invalid syntax * Remove unnecessary testflight check * Just use long commit hash * Slice full hash for display in app * Fix missing space in ios workflow * Pass in sentry CLI env vars, align matching values * Align on RELEASE_VERSION * Add new env setup to missed OTA spot * Update webpack to use same SENTRY_RELEASE var * Just fallback to package version for Render deploys * Remove TF check for BUNDLE_DATE * Set EXPO_PUBLIC_ENV for bundle update * Consistent naming "Env" * Add comment * Use RELEASE_VERSION instead of package.json * Update PR comment CI
65 lines
1.9 KiB
JavaScript
65 lines
1.9 KiB
JavaScript
const createExpoWebpackConfigAsync = require('@expo/webpack-config')
|
|
const {withAlias} = require('@expo/webpack-config/addons')
|
|
const ReactRefreshWebpackPlugin = require('@pmmmwh/react-refresh-webpack-plugin')
|
|
const {BundleAnalyzerPlugin} = require('webpack-bundle-analyzer')
|
|
const {sentryWebpackPlugin} = require('@sentry/webpack-plugin')
|
|
const {version} = require('./package.json')
|
|
|
|
const GENERATE_STATS = process.env.EXPO_PUBLIC_GENERATE_STATS === '1'
|
|
const OPEN_ANALYZER = process.env.EXPO_PUBLIC_OPEN_ANALYZER === '1'
|
|
|
|
const reactNativeWebWebviewConfiguration = {
|
|
test: /postMock.html$/,
|
|
use: {
|
|
loader: 'file-loader',
|
|
options: {
|
|
name: '[name].[ext]',
|
|
},
|
|
},
|
|
}
|
|
|
|
module.exports = async function (env, argv) {
|
|
let config = await createExpoWebpackConfigAsync(env, argv)
|
|
config = withAlias(config, {
|
|
'react-native$': 'react-native-web',
|
|
'react-native-webview': 'react-native-web-webview',
|
|
})
|
|
config.module.rules = [
|
|
...(config.module.rules || []),
|
|
reactNativeWebWebviewConfiguration,
|
|
]
|
|
if (env.mode === 'development') {
|
|
config.plugins.push(new ReactRefreshWebpackPlugin())
|
|
} else {
|
|
// Support static CDN for chunks
|
|
config.output.publicPath = 'auto'
|
|
}
|
|
|
|
if (GENERATE_STATS || OPEN_ANALYZER) {
|
|
config.plugins.push(
|
|
new BundleAnalyzerPlugin({
|
|
openAnalyzer: OPEN_ANALYZER,
|
|
generateStatsFile: true,
|
|
statsFilename: '../stats.json',
|
|
analyzerMode: OPEN_ANALYZER ? 'server' : 'json',
|
|
defaultSizes: 'parsed',
|
|
}),
|
|
)
|
|
}
|
|
if (process.env.SENTRY_AUTH_TOKEN) {
|
|
config.plugins.push(
|
|
sentryWebpackPlugin({
|
|
org: 'blueskyweb',
|
|
project: 'app',
|
|
authToken: process.env.SENTRY_AUTH_TOKEN,
|
|
release: {
|
|
// fallback needed for Render.com deployments
|
|
name: process.env.SENTRY_RELEASE || version,
|
|
dist: process.env.SENTRY_DIST,
|
|
},
|
|
}),
|
|
)
|
|
}
|
|
return config
|
|
}
|