0

I have an ExtJS package with the following structure:

Package
  classic
    resrouces
      file.json

When I build the app with the package in production mode, the file.json is missing.

How can I get the build to include the resources from classic directory (within a package)?

EDIT

Adding the following to package.json enables copying files from both toolkit specific and shared resources directory.

        "resource": {
            "paths": [
                "${package.dir}/resources",
                "${package.dir}/${toolkit.name}/resources"
            ]
        },

However, all the files (from classic/resources/ and resources/) are copied to the same directory (build/production/AppName/classic/resources/PackageName/) and if same filename exists in both directories, one file overwrites the other in the build directory.

build/production/AppName/classic/resources/PackageName/some_resource_file.json

How can they be separated so both files exists in the build?

dev4.life
  • 53
  • 6

1 Answers1

0

In your main project folder, you have the file app.json, where you can define which directories should be copied when building the project and a rule for skipping some of them:

{
    "production": {
        "output": {
            "resources": "resources",
             // ...
         },
    },
    "resources": [{
        "path": "resources", // in your case classic/resources
        "output": "shared"
    }],
    /**
     * File / directory name pattern to ignore when copying to the builds. Must be a
     * valid regular expression.
     */
    "ignore": [
        "(^|/)CVS(/?$|/.*?$)"
    ]
}
Darin Kolev
  • 3,401
  • 13
  • 31
  • 46
  • The following works for resources in app/classic/resources but how do I do the same for package/classic/resources? ` "output": { "resources": { "path": "${build.id}/resources", "shared": "resources", "toolkit": "${toolkit.name}/resources" } }, ` – dev4.life Feb 10 '20 at 15:20
  • just add another resources entry with "path": "package/classic/resources" – Darin Kolev Feb 12 '20 at 12:25