@batijs/build 0.0.140 → 0.0.141

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.
Files changed (2) hide show
  1. package/dist/index.js +21 -13
  2. package/package.json +3 -3
package/dist/index.js CHANGED
@@ -50,20 +50,28 @@ function transformFileAfterExec(filepath, fileContent) {
50
50
  if (fileContent === void 0 || fileContent === null)
51
51
  return null;
52
52
  const parsed = path.parse(filepath);
53
- const ext = parsed.ext || parsed.name;
54
- switch (ext) {
55
- case ".ts":
56
- case ".js":
57
- case ".tsx":
58
- case ".jsx":
59
- case ".env":
60
- case ".html":
61
- return fileContent;
62
- case ".json":
63
- return JSON.stringify(fileContent, null, 2);
64
- default:
65
- throw new Error(`Unsupported extension ${ext} (${filepath})`);
53
+ const toTest = [parsed.base, parsed.ext, parsed.name].filter(Boolean);
54
+ for (const ext of toTest) {
55
+ switch (ext) {
56
+ case ".ts":
57
+ case ".js":
58
+ case ".tsx":
59
+ case ".jsx":
60
+ case ".env":
61
+ case ".env.local":
62
+ case ".env.development":
63
+ case ".env.development.local":
64
+ case ".env.test":
65
+ case ".env.test.local":
66
+ case ".env.production":
67
+ case ".env.production.local":
68
+ case ".html":
69
+ return fileContent;
70
+ case ".json":
71
+ return JSON.stringify(fileContent, null, 2);
72
+ }
66
73
  }
74
+ throw new Error(`Unsupported file extension ${parsed.base} (${filepath})`);
67
75
  }
68
76
  async function importTransformer(p) {
69
77
  const importFile = isWin ? "file://" + p : p;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@batijs/build",
3
- "version": "0.0.140",
3
+ "version": "0.0.141",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "keywords": [],
@@ -10,10 +10,10 @@
10
10
  "devDependencies": {
11
11
  "@types/node": "^18.19.3",
12
12
  "tsup": "^8.0.1",
13
- "@batijs/compile": "0.0.140"
13
+ "@batijs/compile": "0.0.141"
14
14
  },
15
15
  "dependencies": {
16
- "@batijs/core": "0.0.140"
16
+ "@batijs/core": "0.0.141"
17
17
  },
18
18
  "main": "./dist/index.js",
19
19
  "module": "./dist/index.js",