@samual/rolldown-config 0.0.1-25d57ad → 0.0.1-37e5595
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/LICENSE +1 -1
- package/default.d.ts +1 -1
- package/default.js +8 -5
- package/package.json +11 -17
package/LICENSE
CHANGED
package/default.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { type RollupBabelInputPluginOptions } from "@rollup/plugin-babel";
|
|
2
2
|
import { type Options as TerserOptions } from "@rollup/plugin-terser";
|
|
3
|
-
import { type Options as PrettierOptions } from "@samual/rolldown-plugin-prettier";
|
|
4
3
|
import type { LaxPartial } from "@samual/types";
|
|
5
4
|
import type { ConfigExport, RolldownOptions } from "rolldown";
|
|
5
|
+
import { type Options as PrettierOptions } from "rolldown-plugin-prettier";
|
|
6
6
|
type Options = LaxPartial<{
|
|
7
7
|
/**
|
|
8
8
|
* Override the source folder.
|
package/default.js
CHANGED
|
@@ -5,7 +5,6 @@ import babelPresetTypescript from "@babel/preset-typescript"
|
|
|
5
5
|
import { babel } from "@rollup/plugin-babel"
|
|
6
6
|
import terser from "@rollup/plugin-terser"
|
|
7
7
|
import { expect } from "@samual/assert"
|
|
8
|
-
import prettier from "@samual/rolldown-plugin-prettier"
|
|
9
8
|
import { babelPluginHere } from "babel-plugin-here"
|
|
10
9
|
import { babelPluginVitest } from "babel-plugin-vitest"
|
|
11
10
|
import { defu } from "defu"
|
|
@@ -13,6 +12,7 @@ import { readdir } from "fs/promises"
|
|
|
13
12
|
import { cpus } from "os"
|
|
14
13
|
import * as Path from "path"
|
|
15
14
|
import { dts } from "rolldown-plugin-dts"
|
|
15
|
+
import prettier from "rolldown-plugin-prettier"
|
|
16
16
|
const rolldownConfig = async ({
|
|
17
17
|
sourcePath = "src",
|
|
18
18
|
rolldownOptions,
|
|
@@ -35,7 +35,7 @@ const rolldownConfig = async ({
|
|
|
35
35
|
input: Object.fromEntries(
|
|
36
36
|
(await readdir(sourcePath, { withFileTypes: !0, recursive: !0 }))
|
|
37
37
|
.filter(dirent => dirent.isFile())
|
|
38
|
-
.map(dirent => Path.join(
|
|
38
|
+
.map(dirent => Path.join(dirent.parentPath, dirent.name))
|
|
39
39
|
.filter(
|
|
40
40
|
path =>
|
|
41
41
|
(path.endsWith(".js") && !path.endsWith(".test.js")) ||
|
|
@@ -50,7 +50,7 @@ const rolldownConfig = async ({
|
|
|
50
50
|
babelHelpers: "bundled",
|
|
51
51
|
extensions: [".ts"],
|
|
52
52
|
presets: [
|
|
53
|
-
[babelPresetEnv, { targets: { node: "
|
|
53
|
+
[babelPresetEnv, { targets: { node: "22.12" } }],
|
|
54
54
|
[babelPresetTypescript, { allowDeclareFields: !0, optimizeConstEnums: !0 }]
|
|
55
55
|
],
|
|
56
56
|
plugins: [babelPluginHere(), babelPluginVitest()]
|
|
@@ -67,7 +67,10 @@ const rolldownConfig = async ({
|
|
|
67
67
|
experimental?.noSideEffects && {
|
|
68
68
|
name: "no-side-effects",
|
|
69
69
|
async renderChunk(code) {
|
|
70
|
-
const ast = expect(
|
|
70
|
+
const ast = expect(
|
|
71
|
+
await parseAsync(code, { plugins: [babelPluginSyntaxTypescript] }),
|
|
72
|
+
"src/default.ts:153:95"
|
|
73
|
+
),
|
|
71
74
|
indexes = []
|
|
72
75
|
traverse(ast, {
|
|
73
76
|
Function(path) {
|
|
@@ -98,7 +101,7 @@ const rolldownConfig = async ({
|
|
|
98
101
|
output: config.output,
|
|
99
102
|
plugins: [
|
|
100
103
|
dts({ oxc: !0, emitDtsOnly: !0 }),
|
|
101
|
-
experimental
|
|
104
|
+
experimental.disablePrettier ? void 0 : prettier({ ...prettierOptions, parser: "babel-ts" })
|
|
102
105
|
]
|
|
103
106
|
}
|
|
104
107
|
]
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@samual/rolldown-config",
|
|
3
|
-
"version": "0.0.1-
|
|
3
|
+
"version": "0.0.1-37e5595",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "My Rolldown config",
|
|
6
6
|
"keywords": [
|
|
@@ -23,24 +23,18 @@
|
|
|
23
23
|
"@babel/plugin-syntax-typescript": "^7",
|
|
24
24
|
"@babel/preset-env": "^7",
|
|
25
25
|
"@babel/preset-typescript": "^7",
|
|
26
|
-
"@rollup/plugin-babel": "^
|
|
27
|
-
"@rollup/plugin-terser": "^0.
|
|
28
|
-
"@samual/assert": "0.0.1
|
|
29
|
-
"@samual/
|
|
30
|
-
"
|
|
31
|
-
"babel-plugin-
|
|
32
|
-
"babel-plugin-vitest": "0.0.1-7dc1dde",
|
|
26
|
+
"@rollup/plugin-babel": "^7",
|
|
27
|
+
"@rollup/plugin-terser": "^1.0.0",
|
|
28
|
+
"@samual/assert": "^0.0.1",
|
|
29
|
+
"@samual/types": "^0.0.2",
|
|
30
|
+
"babel-plugin-here": "1.0.3-9f222fd",
|
|
31
|
+
"babel-plugin-vitest": "0.0.1-bdec539",
|
|
33
32
|
"defu": "^6",
|
|
34
|
-
"rolldown": "1.0.0-rc.
|
|
35
|
-
"rolldown-plugin-dts": "^0.
|
|
36
|
-
|
|
37
|
-
"pnpm": {
|
|
38
|
-
"patchedDependencies": {
|
|
39
|
-
"defu": "patches/defu.patch",
|
|
40
|
-
"@types/node": "patches/@types__node.patch"
|
|
41
|
-
}
|
|
33
|
+
"rolldown": "1.0.0-rc.15",
|
|
34
|
+
"rolldown-plugin-dts": "^0.23.2",
|
|
35
|
+
"rolldown-plugin-prettier": "0.0.2-a.BTUSLDAcU.DbYQZf"
|
|
42
36
|
},
|
|
43
37
|
"engines": {
|
|
44
|
-
"node": "^
|
|
38
|
+
"node": "^22.12 || >=24"
|
|
45
39
|
}
|
|
46
40
|
}
|