Nx plugin to generate and run your Strapi project.
- Generate Strapi applications in your Nx workspace
- Build Strapi projects with custom output paths
- Development server with auto-reload
- Admin panel development mode
- Environment variable configuration
- Lock file generation support
npm install -D @nx-extend/strapi
nx g @nx-extend/strapi:initBuild your Strapi application:
nx build <project-name>| Name | Type | Default | Description |
|---|---|---|---|
production |
boolean |
false |
Build in production mode |
root |
string |
Project root | Root of the Strapi project to use |
outputPath |
string |
- | Output path to output the build to |
envVars |
object |
- | Define env variables to set before building (can be used in project.json) |
generateLockFile |
boolean |
false |
Generate a lockfile |
Start the Strapi development server:
nx serve <project-name>| Name | Type | Default | Description |
|---|---|---|---|
build |
boolean |
true |
Starts your application with the autoReload enabled and skip the administration panel build process |
watchAdmin |
boolean |
false |
Starts your application with the autoReload enabled and the front-end development server. It allows you to customize the administration panel |
root |
string |
Project root | Root of the Strapi project to use |
envVars |
object |
- | Define env variables to set before building (can be used in project.json) |
{
"build": {
"executor": "@nx-extend/strapi:build",
"options": {
"production": true,
"outputPath": "dist/apps/my-strapi",
"envVars": {
"NODE_ENV": "production"
}
}
}
}{
"serve": {
"executor": "@nx-extend/strapi:serve",
"options": {
"watchAdmin": true,
"envVars": {
"NODE_ENV": "development"
}
}
}
}