mirror of
https://github.com/elyby/accounts-frontend.git
synced 2024-12-23 13:39:54 +05:30
Remove old unused env variables
This commit is contained in:
parent
128f327ec4
commit
76679f03a6
@ -2,8 +2,8 @@ import Raven from 'raven-js';
|
||||
|
||||
import abbreviate from './abbreviate';
|
||||
|
||||
const isTest = process.env.__TEST__; // eslint-disable-line
|
||||
const isProduction = process.env.__PROD__; // eslint-disable-line
|
||||
const isTest = process.env.NODE_ENV === 'test';
|
||||
const isProduction = process.env.NODE_ENV === 'production';
|
||||
|
||||
class Logger {
|
||||
init({ sentryCdn }: { sentryCdn: string }) {
|
||||
@ -11,8 +11,8 @@ class Logger {
|
||||
Raven.config(sentryCdn, {
|
||||
logger: 'accounts-js-app',
|
||||
level: 'info',
|
||||
environment: process.env.APP_ENV, // eslint-disable-line
|
||||
release: process.env.__VERSION__, // eslint-disable-line
|
||||
environment: process.env.APP_ENV,
|
||||
release: process.env.__VERSION__,
|
||||
shouldSendCallback: () => !isTest,
|
||||
dataCallback: data => {
|
||||
if (!data.level) {
|
||||
|
@ -21,11 +21,9 @@ const localeFlags = require('app/components/i18n/localeFlags').default;
|
||||
const rootPath = path.resolve('./packages');
|
||||
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 isTest = process.argv.some(arg => arg.indexOf('karma') !== -1);
|
||||
|
||||
const isDockerized = !!process.env.DOCKERIZED;
|
||||
const isCI = !!process.env.CI;
|
||||
const isSilent = isCI || process.argv.some(arg => /quiet/.test(arg));
|
||||
@ -33,10 +31,6 @@ const isCspEnabled = false;
|
||||
|
||||
process.env.NODE_ENV = isProduction ? 'production' : 'development';
|
||||
|
||||
if (isTest) {
|
||||
process.env.NODE_ENV = 'test';
|
||||
}
|
||||
|
||||
const smp = new SpeedMeasurePlugin();
|
||||
|
||||
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',
|
||||
|
||||
stats: {
|
||||
@ -104,9 +87,6 @@ const webpackConfig = {
|
||||
NODE_ENV: process.env.NODE_ENV,
|
||||
APP_ENV: config.environment || process.env.NODE_ENV,
|
||||
__VERSION__: config.version || '',
|
||||
__DEV__: !isProduction,
|
||||
__TEST__: isTest,
|
||||
__PROD__: isProduction,
|
||||
}),
|
||||
new HtmlWebpackPlugin({
|
||||
template: 'packages/app/index.ejs',
|
||||
@ -288,7 +268,7 @@ if (isProduction) {
|
||||
);
|
||||
}
|
||||
|
||||
if (!isProduction && !isTest) {
|
||||
if (!isProduction) {
|
||||
webpackConfig.devServer = {
|
||||
host: 'localhost',
|
||||
port: 8080,
|
||||
|
Loading…
Reference in New Issue
Block a user