diff --git a/packages/project-config/build.mjs b/packages/project-config/build.mjs new file mode 100644 index 000000000000..ffe56393a3d3 --- /dev/null +++ b/packages/project-config/build.mjs @@ -0,0 +1,22 @@ +import fs from 'node:fs' + +import * as esbuild from 'esbuild' + +const result = await esbuild.build({ + entryPoints: ['src/index.ts'], + outdir: 'dist', + + bundle: true, + + platform: 'node', + target: ['node18'], + packages: 'external', + + logLevel: 'info', + + // For visualizing the bundle. + // See https://esbuild.github.io/api/#metafile and https://esbuild.github.io/analyze/. + metafile: true, +}) + +fs.writeFileSync('meta.json', JSON.stringify(result.metafile)) diff --git a/packages/project-config/package.json b/packages/project-config/package.json index df557bc9a5e2..59dacf42e834 100644 --- a/packages/project-config/package.json +++ b/packages/project-config/package.json @@ -15,9 +15,8 @@ "dist" ], "scripts": { - "build": "run build:js && run build:types", + "build": "yarn node ./build.mjs && run build:types", "build:clean-dist": "rimraf 'dist/**/__tests__' --glob", - "build:js": "babel src -d dist --extensions \".js,.ts,.tsx\" --copy-files --no-copy-ignored && run build:clean-dist", "build:types": "tsc --build --verbose", "build:watch": "nodemon --watch src --ext \"js,ts,tsx\" --ignore dist --exec \"yarn build\"", "deps:dist": "depcruise dist --config --output-type dot | dot -T svg > dependency-graph-dist.svg", @@ -27,17 +26,13 @@ "test:watch": "run test --watch" }, "dependencies": { - "@babel/runtime-corejs3": "7.21.5", "@iarna/toml": "2.2.5", - "core-js": "3.30.2", "deepmerge": "4.3.1", "fast-glob": "3.2.12", "findup-sync": "5.0.0", "string-env-interpolation": "1.0.1" }, "devDependencies": { - "@babel/cli": "7.21.5", - "@babel/core": "7.21.8", "@types/findup-sync": "4.0.2", "dependency-cruiser": "12.12.1", "jest": "29.5.0", diff --git a/yarn.lock b/yarn.lock index 8910ba84e75b..56fc3dd3f28c 100644 --- a/yarn.lock +++ b/yarn.lock @@ -7291,12 +7291,8 @@ __metadata: version: 0.0.0-use.local resolution: "@redwoodjs/project-config@workspace:packages/project-config" dependencies: - "@babel/cli": 7.21.5 - "@babel/core": 7.21.8 - "@babel/runtime-corejs3": 7.21.5 "@iarna/toml": 2.2.5 "@types/findup-sync": 4.0.2 - core-js: 3.30.2 deepmerge: 4.3.1 dependency-cruiser: 12.12.1 fast-glob: 3.2.12