Skip to content

Commit b71a337

Browse files
committed
fixes build
1 parent ab2d3c2 commit b71a337

15 files changed

+417
-1735
lines changed

.gitignore

+3-1
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,6 @@ public/workbox-*.js
2020
public/workbox-*.js.map
2121
public/images/articles/
2222
public/articles.json
23-
public/manifest.json
23+
public/manifest.json
24+
25+
bin/dist/

bin/loader.js

-90
This file was deleted.

bin/build_feed.ts bin/prebuild.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
import { generateFeeds } from '@/lib/feed'
22

3-
generateFeeds()
3+
await generateFeeds()

bin/tsconfig.json

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"compilerOptions": {
3+
"outDir": "./dist",
4+
"esModuleInterop": true,
5+
"baseUrl": "..",
6+
"module": "esnext",
7+
"target": "ES2017",
8+
"moduleResolution": "node",
9+
"paths": {
10+
"@/*": [
11+
"./src/*"
12+
],
13+
"#/metadata.yaml": [
14+
"./metadata.yaml"
15+
]
16+
},
17+
"typeRoots": [
18+
"types",
19+
"node_modules/@types"
20+
],
21+
},
22+
}

jest.config.ts

-22
This file was deleted.

jest/cssTransform.js

-8
This file was deleted.

jest/fileTransformer.js

-8
This file was deleted.

jest/jest.setup.js

-15
This file was deleted.

jest/setupTests.js

-6
This file was deleted.

next-sitemap.config.cjs

-9
This file was deleted.

next.config.mjs

+22-9
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ const withBundleAnalyzer = bundleAnalyzer({
1010

1111
const withPWA = PWA({
1212
dest: 'public',
13-
register: true, skipWaiting: true,
13+
register: true,
14+
skipWaiting: true,
1415
maximumFileSizeToCacheInBytes: 10 * 1024 * 1024,
1516
})
1617

@@ -19,7 +20,7 @@ const withPWA = PWA({
1920
**/
2021
let config = {
2122
webpack(config) {
22-
config.experiments = {...config.experiments, topLevelAwait: true}
23+
config.experiments = { ...config.experiments, topLevelAwait: true }
2324

2425
return config
2526
},
@@ -37,10 +38,10 @@ let config = {
3738
{
3839
protocol: 'https',
3940
hostname: 'pbs.twimg.com',
40-
}
41+
},
4142
],
4243
},
43-
44+
4445
modularizeImports: {
4546
'@/components': {
4647
transform: '@/components/{{member}}',
@@ -52,17 +53,29 @@ const plugins = [
5253
{
5354
plugin: withPWA,
5455
env: ['production'],
56+
name: 'PWA',
5557
},
56-
{ plugin: withSentryConfig, env: ['production'], options: [{}, {
57-
hideSourceMaps: false,
58-
}] },
59-
{ plugin: withBundleAnalyzer },
58+
{
59+
name: 'Sentry',
60+
plugin: withSentryConfig,
61+
env: ['production'],
62+
options: [
63+
{},
64+
{
65+
hideSourceMaps: false,
66+
},
67+
],
68+
},
69+
{ name: 'Bundle Analyzer', plugin: withBundleAnalyzer },
6070
]
6171

72+
console.log('ANALYZE', process.env.ANALYZE === 'true')
73+
6274
for (const plug of plugins) {
6375
if (!plug.env || plug.env.includes(process.env.NODE_ENV)) {
76+
console.log('applying plugin', plug.name)
6477
if (plug.options) config = plug.plugin(config, ...plug.options)
65-
else plug.plugin(config)
78+
else config = plug.plugin(config)
6679
}
6780
}
6881

package.json

+5-10
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,10 @@
1515
"prettier": "prettier --write \"src/**/*.{tsx,ts,less,js,jsx,json}\"",
1616
"eslint": "eslint",
1717
"prepare": "husky",
18-
"prebuild": "node --loader ./bin/loader.js bin/build_feed.ts",
19-
"postbuild": "node --loader ./bin/loader.js bin/postbuild.ts"
18+
"prebuild:build": "esbuild --bundle --format=esm --packages=external --platform=node --target=node20 --outdir=bin/dist bin/prebuild.ts",
19+
"postbuild:build": "esbuild --bundle --format=esm --packages=external --platform=node --target=node20 --outdir=bin/dist bin/postbuild.ts",
20+
"prebuild": "npm run prebuild:build && node bin/dist/prebuild.js",
21+
"postbuild": "npm run postbuild:build && node bin/dist/postbuild.js"
2022
},
2123
"keywords": [
2224
"blog",
@@ -26,7 +28,6 @@
2628
"author": "Robert Koch <[email protected]>",
2729
"license": "MIT",
2830
"devDependencies": {
29-
"@actions/core": "^1.10.1",
3031
"@csstools/postcss-color-mix-function": "^2.0.16",
3132
"@csstools/postcss-hwb-function": "^3.0.15",
3233
"@csstools/postcss-oklab-function": "^3.0.16",
@@ -42,8 +43,6 @@
4243
"@fortawesome/pro-regular-svg-icons": "^6.5.2",
4344
"@fortawesome/pro-solid-svg-icons": "^6.5.2",
4445
"@fortawesome/react-fontawesome": "^0.2.2",
45-
"@jest/globals": "^29.7.0",
46-
"@jest/types": "^29.6.3",
4746
"@mapbox/rehype-prism": "^0.9.0",
4847
"@mdx-js/mdx": "^3.0.1",
4948
"@mdx-js/react": "^3.0.1",
@@ -72,14 +71,13 @@
7271
"@typescript-eslint/eslint-plugin": "^7.10.0",
7372
"@typescript-eslint/parser": "^7.10.0",
7473
"@typescript-eslint/typescript-estree": "^7.10.0",
75-
"@vercel/og": "^0.6.2",
7674
"@vitejs/plugin-react": "^4.3.0",
7775
"autoprefixer": "^10.4.19",
7876
"canvas": "^2.11.2",
7977
"clsx": "^2.1.1",
8078
"csstype": "^3.1.3",
8179
"d3": "^7.9.0",
82-
"encoding": "^0.1.13",
80+
"esbuild": "^0.21.3",
8381
"eslint": "^9.3.0",
8482
"eslint-config-next": "^14.2.3",
8583
"eslint-plugin-import": "^2.29.1",
@@ -91,14 +89,11 @@
9189
"husky": "^9.0.11",
9290
"identity-obj-proxy": "^3.0.0",
9391
"intl-list-format": "^1.0.3",
94-
"jest": "^29.7.0",
95-
"jest-environment-jsdom": "^29.7.0",
9692
"jimp": "^0.22.12",
9793
"js-yaml": "^4.1.0",
9894
"jsdom": "^24.0.0",
9995
"msw": "^2.3.0",
10096
"next": "14.2.3",
101-
"next-mdx-remote": "^5.0.0",
10297
"next-pwa": "^5.6.0",
10398
"next-remote-watch": "^2.0.0",
10499
"node-loader": "^2.0.0",

0 commit comments

Comments
 (0)