Skip to content

Commit d59538a

Browse files
committed
Merge branch 'update-react' of https://github.com/nakrovati/js-framework-benchmark into nakrovati-update-react
2 parents 2cc5baa + 04e0f18 commit d59538a

File tree

5 files changed

+376
-3555
lines changed

5 files changed

+376
-3555
lines changed
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
import { build, context } from "esbuild";
2+
import licensePlugin from "esbuild-plugin-license";
3+
4+
/** @type {import("esbuild-plugin-license").Options;} */
5+
const licensePluginConfig = {
6+
banner: "/*! For license information please see main.js.LICENSE.txt */",
7+
thirdParty: {
8+
output: {
9+
file: "dist/main.js.LICENSE.txt",
10+
template(dependencies) {
11+
return dependencies
12+
.map(
13+
(dependency) =>
14+
`/** ${dependency.packageJson.name} ${dependency.packageJson.version} */\n\n${dependency.licenseText}`
15+
)
16+
.join("\n");
17+
},
18+
},
19+
},
20+
};
21+
22+
/** @type {import("esbuild").BuildOptions;} */
23+
const esbuildConfig = {
24+
entryPoints: ["src/main.jsx"],
25+
bundle: true,
26+
minify: true,
27+
format: "iife",
28+
logLevel: "info",
29+
outfile: "dist/main.js",
30+
plugins: [licensePlugin(licensePluginConfig)],
31+
};
32+
33+
// Activates watch mode
34+
if (process.argv[2] === "--watch") {
35+
const ctx = await context(esbuildConfig);
36+
await ctx.watch();
37+
} else {
38+
await build(esbuildConfig);
39+
}

0 commit comments

Comments
 (0)