Skip to content

Commit

Permalink
build: use executors to build apps instead of plugins so we can gener…
Browse files Browse the repository at this point in the history
…ate package.json in global dist folder
  • Loading branch information
thdk committed Jan 2, 2025
1 parent 2fe33a3 commit f622eab
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 10 deletions.
7 changes: 7 additions & 0 deletions apps/books-api/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@
"projectType": "application",
"tags": ["books", "type:app", "deployable"],
"targets": {
"build": {
"executor": "@nx/webpack:webpack",
"options": {
"webpackConfig": "apps/books-api/webpack.config.js",
"outputPath": "dist/apps/books-api"
}
},
"serve": {
"executor": "@nx/js:node",
"defaultConfiguration": "development",
Expand Down
12 changes: 11 additions & 1 deletion apps/books-app/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,15 @@
"projectType": "application",
"tags": ["type:app", "deployable"],
"// targets": "to see all targets run: nx show project books-app --web",
"targets": {}
"targets": {
"build": {
"executor": "@nx/remix:build",
"options": {
"outputPath": "dist/apps/books-app",
"generatePackageJson": true,
"generateLockfile": true,
"includeDevDependenciesInPackageJson": false
}
}
}
}
11 changes: 3 additions & 8 deletions apps/hello-api/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,10 @@
"tags": ["type:app", "deployable"],
"targets": {
"build": {
"executor": "nx:run-commands",
"executor": "@nx/webpack:webpack",
"options": {
"command": "webpack-cli build",
"args": ["node-env=production"]
},
"configurations": {
"development": {
"args": ["node-env=development"]
}
"webpackConfig": "apps/hello-api/webpack.config.js",
"outputPath": "dist/apps/hello-api"
}
},
"serve": {
Expand Down
2 changes: 1 addition & 1 deletion nx.json
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@
}
},
"version": {
"preVersionCommand": "npx nx run-many -t build --projects libs/*",
"preVersionCommand": "npx nx run-many -t build --projects tag:publishable tag:deployable",
"conventionalCommits": true,
"generatorOptions": {
"updateDependents": "auto",
Expand Down

0 comments on commit f622eab

Please sign in to comment.