Skip to content

Commit fb243d2

Browse files
author
gitbu
committed
temp
1 parent c0b4cc8 commit fb243d2

File tree

11 files changed

+5047
-2102
lines changed

11 files changed

+5047
-2102
lines changed

.babelrc

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"presets": [
3+
"@babel/preset-es2015",
4+
"@babel/preset-react"
5+
],
6+
"plugins": [
7+
["import", {
8+
"libraryName": "antd"
9+
}]
10+
]
11+
}

package-lock.json

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

package.json

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,20 +11,33 @@
1111
"author": "",
1212
"license": "ISC",
1313
"devDependencies": {
14+
"@babel/core": "^7.2.2",
15+
"@babel/preset-env": "^7.2.3",
16+
"@babel/preset-es2015": "^7.0.0-beta.53",
17+
"@babel/preset-react": "^7.0.0",
18+
"@babel/preset-stage-0": "^7.0.0",
1419
"awesome-typescript-loader": "^5.2.1",
15-
"source-map-loader": "^0.2.4",
16-
"typescript": "^3.2.2",
20+
"babel-loader": "^8.0.4",
21+
"babel-plugin-import": "^1.11.0",
22+
"babel-preset-es2015": "^6.24.1",
23+
"babel-preset-react": "^6.24.1",
1724
"css-loader": "^2.0.2",
25+
"source-map-loader": "^0.2.4",
1826
"style-loader": "^0.23.1",
27+
"typescript": "^3.2.2",
28+
"ui-component-loader": "^1.1.6",
1929
"webpack": "^4.28.1",
2030
"webpack-cli": "^3.1.2",
2131
"webpack-dev-server": "^3.1.10"
2232
},
2333
"dependencies": {
34+
"@types/lodash": "^4.14.119",
2435
"@types/react": "^16.7.17",
2536
"@types/react-dom": "^16.0.11",
37+
"antd": "^3.11.2",
2638
"csstype": "^2.5.8",
2739
"html-webpack-plugin": "^3.2.0",
40+
"lodash": "^4.17.11",
2841
"react": "^16.7.0",
2942
"react-dom": "^16.7.0"
3043
}

src/components/A.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import React from 'react'
2+
3+
export default () => {
4+
return (
5+
<div>aaaa</div>
6+
);
7+
}

src/components/App.js

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import * as React from 'react';
2+
import { Button } from 'antd';
3+
import type from '../utils/type';
4+
5+
const A = React.lazy(() => import('./A'))
6+
7+
export default class App extends React.Component {
8+
render() {
9+
console.log(type());
10+
return (
11+
<React.Suspense fallback={<div>loading</div>}>
12+
<Button type="primary">
13+
click me 111
14+
</Button>
15+
<A />
16+
</React.Suspense>
17+
)
18+
}
19+
}

src/components/App.tsx

Lines changed: 0 additions & 11 deletions
This file was deleted.

src/components/Hello.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import * as React from "react";
22

33
export interface HelloProps { compiler: string }
44

5-
export class Hello extends React.Component<HelloProps, {}> {
5+
export default class Hello extends React.Component<HelloProps, {}> {
66
render() {
77
return (
88
<h1>

src/index.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
import * as React from 'react';
22
import * as ReactDom from 'react-dom';
3-
import { Hello } from './components/Hello';
4-
import { App } from './components/App';
3+
/* import { Hello } from './components/Hello'; */
4+
import App from './components/App';
55

66
const B = () => (
77
<div>
88
<App />
9-
<Hello compiler="typescirpt" />
9+
{/* <Hello compiler="typescirpt" /> */}
1010
</div>
1111
)
1212

src/utils/type.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import { sumBy } from 'lodash';
2+
3+
function type() {
4+
const arr = [{a: 1}, {a: 2}]
5+
const res = sumBy(arr, 'a');
6+
console.log(res);
7+
}
8+
9+
export default type;

tsconfig.json

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,12 @@
22
"compilerOptions": {
33
/* Basic Options */
44
"target": "es5", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017','ES2018' or 'ESNEXT'. */
5-
"module": "es6", /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */
6-
// "lib": [], /* Specify library files to be included in the compilation. */
5+
"module": "commonjs", /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */
6+
"lib": [
7+
"es2015",
8+
"dom",
9+
"dom.iterable"
10+
], /* Specify library files to be included in the compilation. */
711
"allowJs": true, /* Allow javascript files to be compiled. */
812
// "checkJs": true, /* Report errors in .js files. */
913
"jsx": "react", /* Specify JSX code generation: 'preserve', 'react-native', or 'react'. */
@@ -43,7 +47,7 @@
4347
// "rootDirs": [], /* List of root folders whose combined content represents the structure of the project at runtime. */
4448
// "typeRoots": [], /* List of folders to include type definitions from. */
4549
// "types": [], /* Type declaration files to be included in compilation. */
46-
// "allowSyntheticDefaultImports": true, /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */
50+
"allowSyntheticDefaultImports": true, /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */
4751
"esModuleInterop": true, /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */
4852
// "preserveSymlinks": true, /* Do not resolve the real path of symlinks. */
4953

0 commit comments

Comments
 (0)