@hpcc-js/esbuild-plugins 1.4.3 → 1.4.5
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/dist/index.js +7 -69
- package/dist/index.js.map +4 -4
- package/dist/sfx-wrapper.js +5 -5
- package/dist/sfx-wrapper.js.map +4 -4
- package/package.json +3 -3
- package/src/build.ts +17 -19
- package/src/index.ts +0 -1
- package/types/index.d.ts +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hpcc-js/esbuild-plugins",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.5",
|
|
4
4
|
"description": "Various esbuild plugins",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"build-ts": "npm run build-ts-dev -- --minify",
|
|
29
29
|
"build-ts-watch": "npm run build-ts-dev -- --watch",
|
|
30
30
|
"build-dev": "run-p build-types build-ts-dev",
|
|
31
|
-
"build-sfx-wrapper-dev": "esbuild ./src/sfx-wrapper.ts --platform=node --format=esm --bundle --
|
|
31
|
+
"build-sfx-wrapper-dev": "esbuild ./src/sfx-wrapper.ts --platform=node --format=esm --bundle --sourcemap --outfile=./dist/sfx-wrapper.js",
|
|
32
32
|
"build-sfx-wrapper": "npm run build-sfx-wrapper-dev -- --minify",
|
|
33
33
|
"build": "run-p build-types build-ts build-sfx-wrapper",
|
|
34
34
|
"lint-skypack": "npx -y @skypack/package-check",
|
|
@@ -62,5 +62,5 @@
|
|
|
62
62
|
},
|
|
63
63
|
"homepage": "https://hpcc-systems.github.io/hpcc-js-wasm/",
|
|
64
64
|
"license": "Apache-2.0",
|
|
65
|
-
"gitHead": "
|
|
65
|
+
"gitHead": "96cd9fe83dd7f2416bd6dbc5f68fb1ad5f08ac96"
|
|
66
66
|
}
|
package/src/build.ts
CHANGED
|
@@ -109,14 +109,16 @@ export function browserTpl(input: string, output: string, options: TplOptions =
|
|
|
109
109
|
target: "es2022",
|
|
110
110
|
globalName: options.globalName,
|
|
111
111
|
keepNames: options.keepNames,
|
|
112
|
-
plugins: options.format === "umd" ? [umdWrapper({ libraryName: options.libraryName })
|
|
112
|
+
plugins: options.format === "umd" ? [...options.plugins ?? [], umdWrapper({ libraryName: options.libraryName })] : options.plugins,
|
|
113
113
|
alias: options.alias,
|
|
114
114
|
define: options.define,
|
|
115
115
|
loader: options.loader,
|
|
116
|
+
supported: options.supported,
|
|
116
117
|
});
|
|
117
118
|
}
|
|
118
119
|
|
|
119
120
|
export function nodeTpl(input: string, output: string, options: TplOptions = {}) {
|
|
121
|
+
options.format = options.format ?? "esm";
|
|
120
122
|
options.packages = options.packages ?? "external";
|
|
121
123
|
if (options.packages === "auto") {
|
|
122
124
|
options.external = autoExternal(options.external);
|
|
@@ -124,41 +126,37 @@ export function nodeTpl(input: string, output: string, options: TplOptions = {})
|
|
|
124
126
|
|
|
125
127
|
return buildWatch([input], {
|
|
126
128
|
format: options.format === "umd" ? "esm" : options.format,
|
|
129
|
+
external: options.external ?? [],
|
|
127
130
|
outfile: `${output}.${options.format === "esm" ? NODE_MJS : NODE_CJS}`,
|
|
128
131
|
platform: "node",
|
|
129
132
|
target: "node22",
|
|
130
133
|
packages: options.packages === "auto" ? "bundle" : options.packages,
|
|
134
|
+
globalName: options.globalName,
|
|
135
|
+
keepNames: options.keepNames,
|
|
136
|
+
plugins: options.plugins,
|
|
137
|
+
alias: options.alias,
|
|
138
|
+
define: options.define,
|
|
139
|
+
loader: options.loader,
|
|
140
|
+
supported: options.supported,
|
|
131
141
|
});
|
|
132
142
|
}
|
|
133
143
|
|
|
134
144
|
export function neutralTpl(input: string, output: string, options: TplOptions = {}) {
|
|
135
145
|
options.format = options.format ?? "esm";
|
|
136
146
|
|
|
137
|
-
let postfix = "";
|
|
138
|
-
switch (options.format) {
|
|
139
|
-
case "iife":
|
|
140
|
-
postfix = "iife.js";
|
|
141
|
-
break;
|
|
142
|
-
case "esm":
|
|
143
|
-
postfix = NODE_MJS;
|
|
144
|
-
break;
|
|
145
|
-
case "cjs":
|
|
146
|
-
postfix = NODE_CJS;
|
|
147
|
-
break;
|
|
148
|
-
case "umd":
|
|
149
|
-
postfix = "umd.js";
|
|
150
|
-
break;
|
|
151
|
-
default:
|
|
152
|
-
throw new Error(`Unknown format: ${options.format}`);
|
|
153
|
-
}
|
|
154
147
|
return buildWatch([input], {
|
|
155
148
|
format: options.format === "umd" ? "esm" : options.format,
|
|
149
|
+
external: options.external ?? [],
|
|
156
150
|
outfile: `${output}.${options.format === "esm" ? "js" : `${options.format}.js`}`,
|
|
157
151
|
platform: "neutral",
|
|
158
152
|
target: "es2022",
|
|
159
153
|
globalName: options.globalName,
|
|
160
154
|
keepNames: options.keepNames,
|
|
161
|
-
plugins: options.format === "umd" ? [umdWrapper({ libraryName: options.libraryName })] :
|
|
155
|
+
plugins: options.format === "umd" ? [...options.plugins ?? [], umdWrapper({ libraryName: options.libraryName })] : options.plugins,
|
|
156
|
+
alias: options.alias,
|
|
157
|
+
define: options.define,
|
|
158
|
+
loader: options.loader,
|
|
159
|
+
supported: options.supported,
|
|
162
160
|
});
|
|
163
161
|
}
|
|
164
162
|
|
package/src/index.ts
CHANGED
package/types/index.d.ts
CHANGED