Skip to content

Commit

Permalink
Build: Adjust project.json task order to ensure `@wp-playground/packa…
Browse files Browse the repository at this point in the history
…ge.json` gets populated with dependencies
  • Loading branch information
adamziel committed Jul 9, 2024
1 parent 47110de commit 7f250ee
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
12 changes: 10 additions & 2 deletions packages/playground/wordpress-builds/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,14 @@
"tsConfig": "packages/playground/wordpress-builds/tsconfig.lib.json",
"outputPath": "dist/packages/playground/wordpress-builds",
"buildTarget": "playground-wordpress-builds:build:bundle:production"
}
},
"dependsOn": ["build:bundle"]
},
"build:bundle": {
"executor": "@nx/vite:build",
"outputs": ["{options.outputPath}"],
"defaultConfiguration": "production",
"emptyOutDir": true,
"options": {
"outputPath": "dist/packages/playground/wordpress-builds"
},
Expand All @@ -40,7 +42,13 @@
"mode": "production"
}
},
"dependsOn": ["^build"]
"dependsOn": ["^build", "build:clear-dist-dir"]
},
"build:clear-dist-dir": {
"executor": "nx:run-commands",
"options": {
"commands": ["rm -rf dist/packages/playground/wordpress-builds"]
}
},
"build:rollup-declarations": {
"executor": "nx:run-commands",
Expand Down
2 changes: 1 addition & 1 deletion packages/playground/wordpress-builds/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ export default defineConfig({
// in the app mode.
// @see https://github.com/vitejs/vite/issues/3295
assetsInlineLimit: 0,
external: getExternalModules(),
rollupOptions: {
external: getExternalModules(),
input: path('src/index.ts'),
// These additional options are required to preserve
// all the exports from the entry point. Otherwise,
Expand Down
4 changes: 3 additions & 1 deletion packages/playground/wordpress/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,14 @@
"tsConfig": "packages/playground/wordpress/tsconfig.lib.json",
"outputPath": "dist/packages/playground/wordpress",
"buildTarget": "playground-wordpress:build:bundle:production"
}
},
"dependsOn": ["build:bundle"]
},
"build:bundle": {
"executor": "@nx/vite:build",
"outputs": ["{options.outputPath}"],
"defaultConfiguration": "production",
"emptyOutDir": true,
"options": {
"outputPath": "dist/packages/playground/wordpress"
},
Expand Down

0 comments on commit 7f250ee

Please sign in to comment.