@pob/rollup-esbuild 5.1.0 → 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 CHANGED
@@ -3,6 +3,16 @@
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
+
6
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)
7
17
 
8
18
  ### Features
@@ -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 = [".ts", jsx && ".tsx", ".json"].filter(Boolean);
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"),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pob/rollup-esbuild",
3
- "version": "5.1.0",
3
+ "version": "5.2.0",
4
4
  "description": "rollup configuration with typescript for pob",
5
5
  "keywords": [],
6
6
  "author": "Christophe Hurpeau <christophe@hurpeau.com> (https://christophe.hurpeau.com)",