@knotx/build-config 0.2.1 → 0.2.3
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/package.json +4 -3
- package/src/index.ts +11 -6
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@knotx/build-config",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.2.
|
|
4
|
+
"version": "0.2.3",
|
|
5
5
|
"description": "Build config for Knotx",
|
|
6
6
|
"author": "boenfu",
|
|
7
7
|
"license": "MIT",
|
|
@@ -29,12 +29,13 @@
|
|
|
29
29
|
"src"
|
|
30
30
|
],
|
|
31
31
|
"dependencies": {
|
|
32
|
+
"@knotx/unbuild": "^3.5.0",
|
|
32
33
|
"magic-string": "^0.30.5",
|
|
33
34
|
"rollup": "^4.9.5"
|
|
34
35
|
},
|
|
35
36
|
"devDependencies": {
|
|
36
|
-
"@knotx/
|
|
37
|
-
"@knotx/
|
|
37
|
+
"@knotx/typescript-config": "0.2.3",
|
|
38
|
+
"@knotx/eslint-config": "0.2.3"
|
|
38
39
|
},
|
|
39
40
|
"scripts": {
|
|
40
41
|
"lint": "eslint ."
|
package/src/index.ts
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import type { BuildConfig } from 'unbuild'
|
|
1
|
+
import type { BuildConfig } from '@knotx/unbuild'
|
|
2
|
+
|
|
3
|
+
import { defineBuildConfig } from '@knotx/unbuild'
|
|
2
4
|
|
|
3
5
|
// import { jsxTransform } from './plugins'
|
|
4
6
|
|
|
5
|
-
|
|
6
|
-
entries: [
|
|
7
|
-
'src/index',
|
|
8
|
-
],
|
|
7
|
+
const buildConfig: BuildConfig = ({
|
|
9
8
|
declaration: true,
|
|
10
9
|
clean: true,
|
|
11
10
|
rollup: {
|
|
@@ -17,11 +16,17 @@ export const buildConfig: BuildConfig = {
|
|
|
17
16
|
},
|
|
18
17
|
},
|
|
19
18
|
failOnWarn: false,
|
|
19
|
+
esmSuffix: 'js',
|
|
20
20
|
// 没想好,暂时不转换,默认使用 react-jsx
|
|
21
21
|
// hooks: {
|
|
22
22
|
// 'rollup:options': (_, options) => {
|
|
23
23
|
// options.plugins.push(jsxTransform())
|
|
24
24
|
// },
|
|
25
25
|
// },
|
|
26
|
-
|
|
26
|
+
})
|
|
27
|
+
|
|
28
|
+
export const defaultBuildConfig = defineBuildConfig(buildConfig)
|
|
29
|
+
|
|
30
|
+
export function buildConfigBuilder(fn: (buildConfig: BuildConfig) => BuildConfig) {
|
|
31
|
+
return defineBuildConfig(fn(buildConfig))
|
|
27
32
|
}
|