Skip to content

Commit d114d55

Browse files
committed
убрать тупняки
1 parent 546c6eb commit d114d55

File tree

5 files changed

+8
-7
lines changed

5 files changed

+8
-7
lines changed

.eslintrc.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,6 @@ module.exports = {
7474
},
7575
globals: {
7676
__IS_DEV__: true,
77-
__API__: true,
77+
__API__: '',
7878
},
7979
};

config/build/types/config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export interface BuildPaths {
1010
export interface BuildEnv {
1111
port: number;
1212
mode: BuildMode;
13-
api: string;
13+
apiUrl: string;
1414
}
1515

1616
export interface BuildOptions {

config/jest/jest.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ export default {
5353
// A set of global variables that need to be available in all test environments
5454
globals: {
5555
__IS_DEV__: true,
56-
__API__: true,
56+
__API__: '',
5757
},
5858
transformIgnorePatterns: ['node_modules/(?!axios)'],
5959

config/storybook/webpack.config.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* eslint-disable @typescript-eslint/no-non-null-assertion */
2-
import webpack, { DefinePlugin } from 'webpack';
32
import path from 'path';
3+
import webpack, { DefinePlugin } from 'webpack';
44
import { buildCssLoader } from '../build/loaders/buildCssLoader';
55
import { BuildPaths } from '../build/types/config';
66

@@ -31,8 +31,8 @@ export default ({ config }: {config: webpack.Configuration}) => {
3131
config.module!.rules!.push(buildCssLoader(true));
3232

3333
config.plugins!.push(new DefinePlugin({
34-
__IS_DEV__: true,
35-
__API__: true,
34+
__IS_DEV__: JSON.stringify(true),
35+
__API__: JSON.stringify(''),
3636
}));
3737

3838
return config;

webpack.config.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,9 @@ export default (env: BuildEnv) => {
1313

1414
const mode = env.mode || 'development';
1515
const PORT = env.port || 3001;
16+
const apiUrl = env.apiUrl || 'http://localhost:8100';
17+
1618
const isDev = mode === 'development';
17-
const apiUrl = isDev ? 'http://localhost:8100' : 'http://production.com';
1819

1920
const config: Configuration = buildWebpackConfig({
2021
mode,

0 commit comments

Comments
 (0)