Skip to content

How to use the ignoreFiles option? #4

@tukusejssirs

Description

@tukusejssirs

I have just found your Nx plugins and it looks promising!

However, I want to ignore some files from being copied during the build step.

In options.ts, I have found the ignoreFiles option:

export interface PhpBuildOptions {
outputName: string | null;
outputPath: string | null;
ignoreFiles: string[] | null;
}

I have apps/app/dockerfile, however it is copied to {options.outputPath}/{options.outputName}, whether I set ignoreFiles to ["dockerfile"] or ["apps/frontend-php/dockerfile"].

Anyway, here is my apps/app/project.json:

apps/app/project.json
{
  "$schema": "../../node_modules/nx/schemas/project-schema.json",
  "name": "app",
  "projectType": "application",
  "sourceRoot": "apps/app/src",
  "tags": [],
  "targets": {
    "build": {
      "dependsOn": [
        "copyComposerJson"
      ],
      "executor": "@nx-php/phpbuild:phpbuild",
      "options": {
        "ignoreFiles": [
          "apps/app/dockerfile"
        ],
        "outputName": "app",
        "outputPath": "dist/apps"
      },
      "outputs": [
        "{options.outputPath}/{options.outputName}"
      ]
    },
    "copyComposerJson": {
      "executor": "nx:run-commands",
      "options": {
        // Note: This script copies the Composer files to `dist/apps/app`
        //       so that I could create a Docker image from the files in `dist/apps/app` only.
        "command": "node scripts/copy-file.js composer.json composer.lock dist/apps/app"
      }
    },
    "test": {
      "dependsOn": [
        "build"
      ],
      "executor": "@nx-php/phpunit:phpunit"
    }
  }
}

Thanks for the creation of these plugins! 🙏

Versions:

  • @nx-php/composer-plugin@0.2.0;
  • @nx-php/phpbuild@0.1.2;
  • @nx-php/phpunit@0.2.0;
  • nx@19.2.3.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions