@pob/rollup-esbuild 5.0.2 → 5.2.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/CHANGELOG.md +16 -0
- package/lib/createRollupConfig.js +19 -2
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,22 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [5.2.0](https://github.com/christophehurpeau/pob/compare/@pob/rollup-esbuild@5.1.0...@pob/rollup-esbuild@5.2.0) (2024-12-05)
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
* getExtensions ([d2b9f72](https://github.com/christophehurpeau/pob/commit/d2b9f72775f59eda2380f2bd9c8596c1daaa7598))
|
|
11
|
+
|
|
12
|
+
### Bug Fixes
|
|
13
|
+
|
|
14
|
+
* **rollup-esbuild:** fix extensions order using loaders ([33fdaee](https://github.com/christophehurpeau/pob/commit/33fdaeeb14e17e7f622ab346cd15621f4c4ed0ae))
|
|
15
|
+
|
|
16
|
+
## [5.1.0](https://github.com/christophehurpeau/pob/compare/@pob/rollup-esbuild@5.0.2...@pob/rollup-esbuild@5.1.0) (2024-12-03)
|
|
17
|
+
|
|
18
|
+
### Features
|
|
19
|
+
|
|
20
|
+
* **rollup:** allow plugins to be a function in createRollupConfig ([67f72d8](https://github.com/christophehurpeau/pob/commit/67f72d83471220199b65e4ffb0fabe7bca048bd2))
|
|
21
|
+
|
|
6
22
|
## [5.0.2](https://github.com/christophehurpeau/pob/compare/@pob/rollup-esbuild@5.0.1...@pob/rollup-esbuild@5.0.2) (2024-12-03)
|
|
7
23
|
|
|
8
24
|
Version bump for dependency: @pob/rollup
|
|
@@ -10,6 +10,7 @@ export default function createRollupConfig({
|
|
|
10
10
|
outDirectory = "dist",
|
|
11
11
|
pkg = JSON.parse(readFileSync(path.join(cwd, "package.json"))),
|
|
12
12
|
plugins = [],
|
|
13
|
+
getExtensions = (v) => v,
|
|
13
14
|
}) {
|
|
14
15
|
const pobConfig = pkg.pob;
|
|
15
16
|
|
|
@@ -23,7 +24,10 @@ export default function createRollupConfig({
|
|
|
23
24
|
const externalByPackageJson = configExternalDependencies(pkg);
|
|
24
25
|
|
|
25
26
|
const createConfigForEnv = (entry, entryPath, env) => {
|
|
26
|
-
const extensions =
|
|
27
|
+
const extensions = getExtensions(
|
|
28
|
+
[".ts", jsx && ".tsx", ".json"],
|
|
29
|
+
env,
|
|
30
|
+
).filter(Boolean);
|
|
27
31
|
const preferConst = true;
|
|
28
32
|
|
|
29
33
|
return {
|
|
@@ -54,6 +58,19 @@ export default function createRollupConfig({
|
|
|
54
58
|
external: externalByPackageJson,
|
|
55
59
|
plugins: [
|
|
56
60
|
esbuild({
|
|
61
|
+
loaders: {
|
|
62
|
+
// https://github.com/egoist/rollup-plugin-esbuild/issues/384
|
|
63
|
+
js: false,
|
|
64
|
+
jsx: false,
|
|
65
|
+
ts: false,
|
|
66
|
+
tsx: false,
|
|
67
|
+
...Object.fromEntries(
|
|
68
|
+
extensions.map((ext) => [
|
|
69
|
+
ext,
|
|
70
|
+
path.extname(`filename${ext}`).slice(1),
|
|
71
|
+
]),
|
|
72
|
+
),
|
|
73
|
+
},
|
|
57
74
|
sourceMap: true,
|
|
58
75
|
minify: false,
|
|
59
76
|
tsconfig: path.resolve(cwd, env.tsconfig || "tsconfig.json"),
|
|
@@ -67,7 +84,7 @@ export default function createRollupConfig({
|
|
|
67
84
|
},
|
|
68
85
|
}),
|
|
69
86
|
|
|
70
|
-
...plugins,
|
|
87
|
+
...(typeof plugins === "function" ? plugins(env) : plugins),
|
|
71
88
|
].filter(Boolean),
|
|
72
89
|
};
|
|
73
90
|
};
|
package/package.json
CHANGED