@surplus/esbuild 1.0.1 → 1.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/index.mjs +9 -2
- package/package.json +2 -2
package/index.mjs
CHANGED
|
@@ -9,9 +9,15 @@ const BASE_RESULT = {
|
|
|
9
9
|
export default (opts) => ({
|
|
10
10
|
name: "surplus",
|
|
11
11
|
setup(build) {
|
|
12
|
-
const
|
|
12
|
+
const jsFileExtensions = [".js", ".jsx", ".mjs", ".cjs"];
|
|
13
|
+
const tsFileExtensions = [".ts", ".tsx"];
|
|
13
14
|
|
|
14
|
-
|
|
15
|
+
const fileExtensions = [
|
|
16
|
+
...jsFileExtensions.map((e) => [e, false]),
|
|
17
|
+
...tsFileExtensions.map((e) => [e, true]),
|
|
18
|
+
];
|
|
19
|
+
|
|
20
|
+
for (const [ext, ts] of fileExtensions) {
|
|
15
21
|
build.onLoad({ filter: new RegExp(`\\${ext}$`) }, async (args) => {
|
|
16
22
|
try {
|
|
17
23
|
const source = await fsp.readFile(args.path, "utf8");
|
|
@@ -20,6 +26,7 @@ export default (opts) => ({
|
|
|
20
26
|
source,
|
|
21
27
|
minify: false,
|
|
22
28
|
sourcemapFilename: args.path,
|
|
29
|
+
typescript: ts,
|
|
23
30
|
...opts,
|
|
24
31
|
});
|
|
25
32
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@surplus/esbuild",
|
|
3
|
-
"version": "1.0
|
|
3
|
+
"version": "1.2.0",
|
|
4
4
|
"description": "Surplus framework ESBuild plugin",
|
|
5
5
|
"author": "Josh Junon (https://github.com/qix-)",
|
|
6
6
|
"license": "MIT",
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"README.md"
|
|
29
29
|
],
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@surplus/compiler": "^1.
|
|
31
|
+
"@surplus/compiler": "^1.2.0"
|
|
32
32
|
},
|
|
33
33
|
"engines": {
|
|
34
34
|
"node": "^12.17.0 || ^14.13 || >=16.0.0"
|