Remove old unused env variables

This commit is contained in:
SleepWalker 2019-12-09 09:47:24 +02:00
parent 128f327ec4
commit 76679f03a6
2 changed files with 6 additions and 26 deletions

View File

@ -2,8 +2,8 @@ import Raven from 'raven-js';
import abbreviate from './abbreviate'; import abbreviate from './abbreviate';
const isTest = process.env.__TEST__; // eslint-disable-line const isTest = process.env.NODE_ENV === 'test';
const isProduction = process.env.__PROD__; // eslint-disable-line const isProduction = process.env.NODE_ENV === 'production';
class Logger { class Logger {
init({ sentryCdn }: { sentryCdn: string }) { init({ sentryCdn }: { sentryCdn: string }) {
@ -11,8 +11,8 @@ class Logger {
Raven.config(sentryCdn, { Raven.config(sentryCdn, {
logger: 'accounts-js-app', logger: 'accounts-js-app',
level: 'info', level: 'info',
environment: process.env.APP_ENV, // eslint-disable-line environment: process.env.APP_ENV,
release: process.env.__VERSION__, // eslint-disable-line release: process.env.__VERSION__,
shouldSendCallback: () => !isTest, shouldSendCallback: () => !isTest,
dataCallback: data => { dataCallback: data => {
if (!data.level) { if (!data.level) {

View File

@ -21,11 +21,9 @@ const localeFlags = require('app/components/i18n/localeFlags').default;
const rootPath = path.resolve('./packages'); const rootPath = path.resolve('./packages');
const outputPath = path.join(__dirname, 'dist'); const outputPath = path.join(__dirname, 'dist');
const isProduction = process.argv.some(arg => arg === '-p'); const isProduction = process.env.NODE_ENV === 'production';
const isAnalyze = process.argv.some(arg => arg === '--analyze'); const isAnalyze = process.argv.some(arg => arg === '--analyze');
const isTest = process.argv.some(arg => arg.indexOf('karma') !== -1);
const isDockerized = !!process.env.DOCKERIZED; const isDockerized = !!process.env.DOCKERIZED;
const isCI = !!process.env.CI; const isCI = !!process.env.CI;
const isSilent = isCI || process.argv.some(arg => /quiet/.test(arg)); const isSilent = isCI || process.argv.some(arg => /quiet/.test(arg));
@ -33,10 +31,6 @@ const isCspEnabled = false;
process.env.NODE_ENV = isProduction ? 'production' : 'development'; process.env.NODE_ENV = isProduction ? 'production' : 'development';
if (isTest) {
process.env.NODE_ENV = 'test';
}
const smp = new SpeedMeasurePlugin(); const smp = new SpeedMeasurePlugin();
const webpackConfig = { const webpackConfig = {
@ -62,17 +56,6 @@ const webpackConfig = {
}, },
}, },
externals: isTest
? {
sinon: 'sinon',
// http://airbnb.io/enzyme/docs/guides/webpack.html
cheerio: 'window',
'react/lib/ExecutionEnvironment': true,
'react/lib/ReactContext': true,
'react/addons': true,
}
: {},
devtool: 'cheap-module-source-map', devtool: 'cheap-module-source-map',
stats: { stats: {
@ -104,9 +87,6 @@ const webpackConfig = {
NODE_ENV: process.env.NODE_ENV, NODE_ENV: process.env.NODE_ENV,
APP_ENV: config.environment || process.env.NODE_ENV, APP_ENV: config.environment || process.env.NODE_ENV,
__VERSION__: config.version || '', __VERSION__: config.version || '',
__DEV__: !isProduction,
__TEST__: isTest,
__PROD__: isProduction,
}), }),
new HtmlWebpackPlugin({ new HtmlWebpackPlugin({
template: 'packages/app/index.ejs', template: 'packages/app/index.ejs',
@ -288,7 +268,7 @@ if (isProduction) {
); );
} }
if (!isProduction && !isTest) { if (!isProduction) {
webpackConfig.devServer = { webpackConfig.devServer = {
host: 'localhost', host: 'localhost',
port: 8080, port: 8080,