Skip to content

Commit 6c48091

Browse files
committed
Careers - Update
Moved from Greenhouse to Gem.com
1 parent 7963e7a commit 6c48091

File tree

15 files changed

+329
-150
lines changed

15 files changed

+329
-150
lines changed

.DS_Store

2 KB
Binary file not shown.

bin/build 2.js

Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
import * as esbuild from 'esbuild';
2+
import { readdirSync } from 'fs';
3+
import { join, sep } from 'path';
4+
5+
// Config output
6+
const BUILD_DIRECTORY = 'dist';
7+
const PRODUCTION = process.env.NODE_ENV === 'production';
8+
9+
// Config entrypoint files
10+
const ENTRY_POINTS = [
11+
'src/index.js',
12+
'src/homepage-new.js',
13+
'src/legacy.js',
14+
'src/cookies.js',
15+
'src/sales.js',
16+
'src/modconf.js',
17+
'src/performance.js',
18+
'src/mojo.js',
19+
'src/about.js',
20+
'src/careers.js',
21+
'src/blog.js',
22+
'src/blog-live-reload.js',
23+
'src/blog-code-highlight.js',
24+
];
25+
26+
// Config dev serving
27+
const LIVE_RELOAD = !PRODUCTION;
28+
const SERVE_PORT = 3000;
29+
const SERVE_ORIGIN = `http://localhost:${SERVE_PORT}`;
30+
31+
// Create context
32+
const context = await esbuild.context({
33+
bundle: true,
34+
entryPoints: ENTRY_POINTS,
35+
outdir: BUILD_DIRECTORY,
36+
minify: PRODUCTION,
37+
sourcemap: !PRODUCTION,
38+
target: PRODUCTION ? 'es2022' : 'esnext',
39+
inject: LIVE_RELOAD ? ['./bin/live-reload.js'] : undefined,
40+
define: {
41+
SERVE_ORIGIN: JSON.stringify(SERVE_ORIGIN),
42+
},
43+
external: ['jquery', 'gsap', 'gsap/ScrollTrigger', 'gsap/ScrollTo', 'swiper'],
44+
});
45+
46+
// Build files in prod
47+
if (PRODUCTION) {
48+
await context.rebuild();
49+
context.dispose();
50+
}
51+
52+
// Watch and serve files in dev
53+
else {
54+
await context.watch();
55+
await context
56+
.serve({
57+
servedir: BUILD_DIRECTORY,
58+
port: SERVE_PORT,
59+
})
60+
.then(logServedFiles);
61+
}
62+
63+
/**
64+
* Logs information about the files that are being served during local development.
65+
*/
66+
function logServedFiles() {
67+
/**
68+
* Recursively gets all files in a directory.
69+
* @param {string} dirPath
70+
* @returns {string[]} An array of file paths.
71+
*/
72+
const getFiles = (dirPath) => {
73+
const files = readdirSync(dirPath, { withFileTypes: true }).map((dirent) => {
74+
const path = join(dirPath, dirent.name);
75+
return dirent.isDirectory() ? getFiles(path) : path;
76+
});
77+
78+
return files.flat();
79+
};
80+
81+
const files = getFiles(BUILD_DIRECTORY);
82+
83+
const filesInfo = files
84+
.map((file) => {
85+
if (file.endsWith('.map')) return;
86+
87+
// Normalize path and create file location
88+
const paths = file.split(sep);
89+
paths[0] = SERVE_ORIGIN;
90+
91+
const location = paths.join('/');
92+
93+
// Create import suggestion
94+
const tag = location.endsWith('.css')
95+
? `<link href="${location}" rel="stylesheet" type="text/css"/>`
96+
: `<script defer src="${location}"></script>`;
97+
98+
return {
99+
'File Location': location,
100+
'Import Suggestion': tag,
101+
};
102+
})
103+
.filter(Boolean);
104+
105+
// eslint-disable-next-line no-console
106+
console.table(filesInfo);
107+
}

dist/.DS_Store

6 KB
Binary file not shown.

dist/about.js.map

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/blog.js.map

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/careers.js

Lines changed: 14 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/careers.js.map

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/community.js.map

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)