Skip to content

Commit f622eab

Browse files
committed
build: use executors to build apps instead of plugins so we can generate package.json in global dist folder
1 parent 2fe33a3 commit f622eab

File tree

4 files changed

+22
-10
lines changed

4 files changed

+22
-10
lines changed

apps/books-api/project.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,13 @@
55
"projectType": "application",
66
"tags": ["books", "type:app", "deployable"],
77
"targets": {
8+
"build": {
9+
"executor": "@nx/webpack:webpack",
10+
"options": {
11+
"webpackConfig": "apps/books-api/webpack.config.js",
12+
"outputPath": "dist/apps/books-api"
13+
}
14+
},
815
"serve": {
916
"executor": "@nx/js:node",
1017
"defaultConfiguration": "development",

apps/books-app/project.json

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,15 @@
55
"projectType": "application",
66
"tags": ["type:app", "deployable"],
77
"// targets": "to see all targets run: nx show project books-app --web",
8-
"targets": {}
8+
"targets": {
9+
"build": {
10+
"executor": "@nx/remix:build",
11+
"options": {
12+
"outputPath": "dist/apps/books-app",
13+
"generatePackageJson": true,
14+
"generateLockfile": true,
15+
"includeDevDependenciesInPackageJson": false
16+
}
17+
}
18+
}
919
}

apps/hello-api/project.json

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,10 @@
66
"tags": ["type:app", "deployable"],
77
"targets": {
88
"build": {
9-
"executor": "nx:run-commands",
9+
"executor": "@nx/webpack:webpack",
1010
"options": {
11-
"command": "webpack-cli build",
12-
"args": ["node-env=production"]
13-
},
14-
"configurations": {
15-
"development": {
16-
"args": ["node-env=development"]
17-
}
11+
"webpackConfig": "apps/hello-api/webpack.config.js",
12+
"outputPath": "dist/apps/hello-api"
1813
}
1914
},
2015
"serve": {

nx.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@
135135
}
136136
},
137137
"version": {
138-
"preVersionCommand": "npx nx run-many -t build --projects libs/*",
138+
"preVersionCommand": "npx nx run-many -t build --projects tag:publishable tag:deployable",
139139
"conventionalCommits": true,
140140
"generatorOptions": {
141141
"updateDependents": "auto",

0 commit comments

Comments
 (0)