Skip to content

Commit f40e840

Browse files
committed
Merge branch 'master' of https://github.com/zouloux/js-framework-benchmark-reflex into zouloux-master
2 parents cf41a4e + ff94983 commit f40e840

File tree

6 files changed

+715
-0
lines changed

6 files changed

+715
-0
lines changed
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
import esbuild from "esbuild";
2+
3+
// ----------------------------------------------------------------------------- BUILD MODE
4+
const buildMode = (process.argv[2] ?? "dev").toLowerCase();
5+
const isDev = buildMode === "dev"
6+
if ( buildMode !== 'prod' && buildMode !== 'dev' ) {
7+
console.error("Build mode need to be 'prod' or 'dev'.")
8+
process.exit(0)
9+
}
10+
11+
// ----------------------------------------------------------------------------- BUILD CONTEXT
12+
// Create build context
13+
const _buildContext = await esbuild.context({
14+
//target: [ 'chrome58', 'edge18', 'firefox57', 'safari11' ],
15+
platform: "browser",
16+
format: "iife",
17+
// minify: !isDev,
18+
// Mangle all properties starting with an underscore
19+
mangleProps: isDev ? undefined : /^_/,
20+
// Important to keep perfs
21+
// and disable compressing "if ( a ) b()" in "a && b()"
22+
minifyWhitespace: !isDev,
23+
minifyIdentifiers: !isDev,
24+
minifySyntax: false,
25+
keepNames: true,
26+
27+
bundle: true,
28+
loader: {
29+
'.ts' : 'ts',
30+
'.tsx' : 'tsx'
31+
},
32+
metafile: true,
33+
write: true,
34+
plugins: [],
35+
define: {
36+
"process.env.NODE_ENV": isDev ? `"development"` : `"production"`
37+
},
38+
logLevel: "info",
39+
outbase: "./src/",
40+
entryPoints: ["./src/main.tsx"],
41+
outdir: "./dist/"
42+
})
43+
44+
// ----------------------------------------------------------------------------- DEV OR BUILD
45+
46+
// Dev mode
47+
if ( isDev ) {
48+
await _buildContext.watch()
49+
}
50+
// Build mode
51+
else {
52+
await _buildContext.rebuild()
53+
await _buildContext.dispose()
54+
}

frameworks/keyed/reflex-js/index.html

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="utf-8" />
5+
<title>Reflex-DOM</title>
6+
<link href="/css/currentStyle.css" rel="stylesheet"/>
7+
</head>
8+
<body>
9+
<div id="main"></div>
10+
<script src="./dist/main.js" type="module"></script>
11+
</body>
12+
</html>

0 commit comments

Comments
 (0)