Skip to content

Commit e39f014

Browse files
committed
Modify Babel config.
1 parent e1832ce commit e39f014

File tree

9 files changed

+740
-159
lines changed

9 files changed

+740
-159
lines changed

.babelrc

Lines changed: 88 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,90 @@
11
{
22
"presets": [
3-
"@babel/preset-react"
4-
]
5-
}
3+
"@babel/env",
4+
"@babel/preset-react",
5+
"@babel/typescript"
6+
],
7+
"plugins": [
8+
"@babel/proposal-class-properties",
9+
],
10+
"env": {
11+
"umd": {
12+
"presets": [
13+
[ "@babel/preset-env", { "modules": "umd" } ]
14+
],
15+
"plugins": [
16+
"@babel/plugin-transform-modules-umd",
17+
"@babel/plugin-transform-runtime",
18+
[
19+
"babel-plugin-transform-rename-import",
20+
{
21+
"original": "^(.+?)\\.less$",
22+
"replacement": "$1.css"
23+
}
24+
]
25+
]
26+
},
27+
"esm": {
28+
"presets": [
29+
[ "@babel/preset-env", { "modules": false } ]
30+
],
31+
"plugins": [
32+
[ "@babel/plugin-transform-runtime", { "useESModules": true } ],
33+
[ "babel-plugin-transform-rename-import", { "original": "^(.+?)\\.less$", "replacement": "$1.css" } ]
34+
]
35+
},
36+
"cjs": {
37+
"presets": [
38+
[ "@babel/preset-env", { "modules": false } ]
39+
],
40+
"plugins": [
41+
[ "@babel/plugin-transform-runtime", { "useESModules": true } ],
42+
[ "babel-plugin-transform-remove-imports", { "test": "(less|css)$" } ]
43+
]
44+
}
45+
}
46+
}
47+
48+
// {
49+
// "presets": [
50+
// "@babel/preset-react",
51+
// ["@babel/preset-typescript", {
52+
// "isTSX": true,
53+
// "allExtensions": true
54+
// }]
55+
// ],
56+
// "env": {
57+
// "esm": {
58+
// "presets": [
59+
// "@babel/preset-react",
60+
// [
61+
// "@babel/preset-typescript",
62+
// {
63+
// "isTSX": true,
64+
// "allExtensions": true
65+
// }
66+
// ]
67+
// ],
68+
// "plugins": [
69+
// // [
70+
// // "@babel/plugin-transform-runtime",
71+
// // {
72+
// // "useESModules": true
73+
// // }
74+
// // ],
75+
// // [
76+
// // "babel-plugin-transform-rename-import",
77+
// // {
78+
// // "original": "^(.+?)\\.less$",
79+
// // "replacement": "$1.css"
80+
// // }
81+
// // ]
82+
// ]
83+
// },
84+
// "cjs": {
85+
// "presets": [
86+
// // "@babel/preset-env",
87+
// ],
88+
// }
89+
// }
90+
// }

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
cjs
22
esm
33
esnext
4+
umd
5+
typing
6+
dist
47
node_modules
58
doc
69
build

README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,15 @@ ReactDOM.render(
7474
- value (*string*) - the raw markdown that will be converted to html (**required**)
7575
- onChange (*function*) - called when a change is made (**required**)
7676

77+
78+
### Development
79+
80+
```bash
81+
npm run dev
82+
npm run type-check:watch
83+
npm run doc
84+
```
85+
7786
## License
7887

7988
[MIT © Kenny Wong](./LICENSE)

0 commit comments

Comments
 (0)