Skip to content

Commit 6e0f5bd

Browse files
committed
refactor(*): use babel-loader instead of awesome-typescript-loader for typescript
1 parent ddd0d92 commit 6e0f5bd

26 files changed

+576
-276
lines changed

.babelrc

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
11
{
2-
"presets": ["@babel/preset-env", "@babel/preset-react"]
3-
}
2+
"presets": [
3+
"@babel/preset-env",
4+
"@babel/preset-react",
5+
"@babel/preset-typescript"
6+
],
7+
"plugins": [
8+
"@babel/plugin-transform-runtime",
9+
"@babel/proposal-class-properties",
10+
"@babel/proposal-object-rest-spread"
11+
]
12+
}

package-lock.json

Lines changed: 447 additions & 163 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,14 @@
5555
},
5656
"devDependencies": {
5757
"@babel/core": "^7.4.3",
58+
"@babel/plugin-proposal-class-properties": "^7.12.1",
59+
"@babel/plugin-proposal-object-rest-spread": "^7.12.1",
60+
"@babel/plugin-transform-runtime": "^7.12.1",
5861
"@babel/preset-env": "^7.4.3",
5962
"@babel/preset-react": "^7.0.0",
63+
"@babel/preset-typescript": "^7.12.1",
6064
"@bndynet/header-injection-webpack-plugin": "^4.0.1",
65+
"@pmmmwh/react-refresh-webpack-plugin": "^0.4.2",
6166
"@types/classnames": "^2.2.6",
6267
"@types/lodash-es": "^4.17.3",
6368
"@types/react": "^16.8.17",
@@ -70,7 +75,6 @@
7075
"@typescript-eslint/eslint-plugin": "^1.9.0",
7176
"@typescript-eslint/parser": "^1.9.0",
7277
"autoprefixer": "^9.5.0",
73-
"awesome-typescript-loader": "^5.2.1",
7478
"babel-loader": "^8.0.4",
7579
"base-href-webpack-plugin": "^2.0.0",
7680
"clean-webpack-plugin": "^1.0.1",
@@ -91,6 +95,7 @@
9195
"postcss-loader": "^3.0.0",
9296
"prettier": "^1.17.1",
9397
"print-time-webpack": "^2.0.3",
98+
"react-refresh": "^0.9.0",
9499
"redux-devtools-extension": "^2.13.8",
95100
"redux-logger": "^3.0.6",
96101
"sass-loader": "^7.0.1",

src/App.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import {
1111
LinearProgress,
1212
} from '@material-ui/core';
1313

14-
import { routes } from 'app/config';
14+
import { routes } from './routers/routes';
1515
import { themeConfig } from 'app/theme';
1616
import { Notifier, NotifierOptions, Overlay, Loading } from 'app/ui';
1717
import { actions as globalActions } from 'app/service/global';

src/config/app.common.tsx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import { Config } from '.';
1+
import { Config } from './types';
22

3-
const config: Config = {
3+
export const config: Config = {
44
title: 'admin.brand',
55
logoUri: 'https://static.bndy.net/images/logo_white.svg',
66
resourceBaseUri: APP_BASEHREF || '/',
@@ -19,5 +19,3 @@ const config: Config = {
1919
},
2020
],
2121
};
22-
23-
module.exports = config;

src/config/app.dev.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1 @@
1-
import config = require('./app.mock');
2-
3-
module.exports = config;
1+
export { config } from './app.mock';

src/config/app.github.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Config, AuthType } from '.';
1+
import { Config, AuthType } from './types';
22

33
const config: Config = {
44
authType: AuthType.OAuth,

src/config/app.mock.tsx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import { Config, AuthType } from '.';
1+
import { Config, AuthType } from './types';
22

3-
const config: Config = {
3+
export const config: Config = {
44
authType: AuthType.Mock,
55
userConverter: (mockUser: any) => {
66
return {
@@ -11,5 +11,3 @@ const config: Config = {
1111
};
1212
},
1313
};
14-
15-
module.exports = config;

src/config/app.oauth-code.tsx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import { Config, AuthType } from '.';
1+
import { Config, AuthType } from './types';
22

3-
const config: Config = {
3+
export const config: Config = {
44
authType: AuthType.OAuth,
55
authConfig: {
66
clientId: 'foo',
@@ -26,5 +26,3 @@ const config: Config = {
2626
};
2727
},
2828
};
29-
30-
module.exports = config;

src/config/app.oauth-password.tsx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import { Config, AuthType } from '.';
1+
import { Config, AuthType } from './types';
22

3-
const config: Config = {
3+
export const config: Config = {
44
authType: AuthType.OAuthPassword,
55
authConfig: {
66
clientId: 'foo',
@@ -19,5 +19,3 @@ const config: Config = {
1919
};
2020
},
2121
};
22-
23-
module.exports = config;

0 commit comments

Comments
 (0)