@fictjs/babel-preset 0.8.0 → 0.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +55 -0
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -15,3 +15,58 @@ yarn add -D @fictjs/babel-preset
|
|
|
15
15
|
```
|
|
16
16
|
|
|
17
17
|
You can visit [Fict](https://github.com/fictjs/fict) for more documentation.
|
|
18
|
+
|
|
19
|
+
## Configuration
|
|
20
|
+
|
|
21
|
+
`@fictjs/babel-preset` includes:
|
|
22
|
+
|
|
23
|
+
- `@babel/preset-typescript` (enabled by default)
|
|
24
|
+
- `@babel/plugin-syntax-jsx`
|
|
25
|
+
- `@fictjs/compiler`
|
|
26
|
+
|
|
27
|
+
All compiler options are forwarded through this preset.
|
|
28
|
+
|
|
29
|
+
```js
|
|
30
|
+
// babel.config.js
|
|
31
|
+
module.exports = {
|
|
32
|
+
presets: [
|
|
33
|
+
[
|
|
34
|
+
'@fictjs/babel-preset',
|
|
35
|
+
{
|
|
36
|
+
// Preset-level options
|
|
37
|
+
typescript: true,
|
|
38
|
+
typescriptOptions: {
|
|
39
|
+
isTSX: true,
|
|
40
|
+
allExtensions: true,
|
|
41
|
+
allowNamespaces: true,
|
|
42
|
+
},
|
|
43
|
+
// Compiler options (forwarded)
|
|
44
|
+
strictGuarantee: true,
|
|
45
|
+
emitModuleMetadata: 'auto',
|
|
46
|
+
},
|
|
47
|
+
],
|
|
48
|
+
],
|
|
49
|
+
}
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
Recommended profiles:
|
|
53
|
+
|
|
54
|
+
```js
|
|
55
|
+
// Strict default app/CI profile
|
|
56
|
+
module.exports = {
|
|
57
|
+
presets: [['@fictjs/babel-preset', { strictGuarantee: true }]],
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
// Migration / benchmark profile
|
|
61
|
+
module.exports = {
|
|
62
|
+
presets: [
|
|
63
|
+
['@fictjs/babel-preset', { strictGuarantee: false, emitModuleMetadata: false, dev: false }],
|
|
64
|
+
],
|
|
65
|
+
}
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
Key defaults:
|
|
69
|
+
|
|
70
|
+
- compiler `strictGuarantee`: `true`
|
|
71
|
+
- compiler `emitModuleMetadata`: `'auto'`
|
|
72
|
+
- preset `typescript`: `true`
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fictjs/babel-preset",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.10.0",
|
|
4
4
|
"description": "Babel preset for Fict - includes TypeScript, JSX, and Fict compiler",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"dependencies": {
|
|
27
27
|
"@babel/plugin-syntax-jsx": "^7.28.6",
|
|
28
28
|
"@babel/preset-typescript": "^7.26.0",
|
|
29
|
-
"@fictjs/compiler": "0.
|
|
29
|
+
"@fictjs/compiler": "0.10.0"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
32
|
"@babel/core": "^7.28.6",
|