Skip to content

Commit 15045f8

Browse files
committed
docs(compare): add example
1 parent 2e7e6b3 commit 15045f8

File tree

4 files changed

+50
-1328
lines changed

4 files changed

+50
-1328
lines changed
Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* @since 2019-11-01 20:44:29
44
*/
55
import loadable from '@loadable/component';
6-
export const DefaultLoadable = loadable({
6+
export const LazyFoo = loadable({
77
chunkName() {
88
return 'input-AsyncDefaultComponent';
99
},
@@ -19,15 +19,6 @@ export const DefaultLoadable = loadable({
1919
requireAsync: () =>
2020
import(
2121
/* webpackChunkName: "input-AsyncDefaultComponent" */
22-
23-
/* comment */
24-
25-
/* comment 2 */
26-
27-
/** comment 3 */
28-
/// comment 5
29-
30-
/* comment 4 */
3122
'./input/AsyncDefaultComponent'
3223
),
3324

compare/output_typescript-loadable-components-plugin.js renamed to compare/output_typescript.js

File renamed without changes.

package.json

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,9 @@
4040
"prepublishOnly": "run-s test build",
4141
"start": "npm run clean && npm run build:esm -- --watch",
4242
"test": "jest",
43-
"compare:babel": "babel -o ./compare/output_loadable__babel-plugin.js ./compare/source.ts",
44-
"compare:self": "ttsc -p tsconfig.self.json && mv compare/source.js compare/output_typescript-loadable-components-plugin.js && rm -rf compare/input/*.js"
43+
"compare:babel": "babel -o ./compare/output_babel.js ./compare/source.ts",
44+
"compare:self": "ttsc -p tsconfig.self.json && mv compare/source.js compare/output_typescript.js && rm -rf compare/input/*.js",
45+
"compare": "rm -rf ./compare/output_* && run-p compare:babel compare:self && prettier --write ./compare/output_*"
4546
},
4647
"repository": {
4748
"type": "git",
@@ -60,7 +61,6 @@
6061
"@types/loadable__component": "^5.10.0",
6162
"@types/node": "^12.12.3",
6263
"@types/react": "^16.9.11",
63-
"@types/webpack": "^4.39.7",
6464
"husky": "^3.0.9",
6565
"jest": "^24.9.0",
6666
"lint-staged": "^9.4.2",
@@ -69,9 +69,7 @@
6969
"react": "^16.11.0",
7070
"ts-jest": "^24.1.0",
7171
"ts-loader": "^6.2.1",
72-
"ttypescript": "^1.5.7",
73-
"webpack": "^4.41.2",
74-
"webpack-cli": "^3.3.10"
72+
"ttypescript": "^1.5.7"
7573
},
7674
"dependencies": {
7775
"tslib": "^1.10.0",

0 commit comments

Comments
 (0)