ExtJS Package toolkit/shared resources

417 Views Asked by At

I have an ExtJS package with the following structure:

PackageA/
  classic/
    resrouces/
      file.json
      classic_resource.json
  resources/
    file.json
    resource.json

When I build the app in production mode requiring the packageA, in the build directory I see the following:

./build/production/MyApp/classic/resources/PackageA/file.json
./build/production/MyApp/classic/resources/PackageA/classic_resource.json
./build/production/MyApp/classic/resources/PackageA/resource.json

It looks like both the shared package resources and toolkit (classic) specific are copied to the same directory (./MyApp/classic/resources/PackageA/), and if the same file exists already, it will simply be overwritten (file.json).

However, in my case the classic/resources/file.json and resources/file.json have different content and I require to keep them both in the build.

How can I achieve this?

[EDIT]

app.json

    "output": {
        "base": "${workspace.build.dir}/${build.environment}/${app.name}",
        "page": "index.html",
        "manifest": "${build.id}.json",
        "js": "${build.id}/app.js",
        "appCache": {
            "enable": false
        },
        "resources": {
            "path": "${build.id}/resources",
            "shared": "resources"
        },

        "framework": {
            "path": "${build.id}/framework.js",
            "enable": true
        }
    },

    "resources": [
        {
            "path": "resources",
            "output": "shared"
        },
        {
            "path": "${toolkit.name}/resources"
        },
        {
            "path": "${build.id}/resources"
        }
    ],

package.json

"output": "${package.dir}/build",

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

There are 1 best solutions below

0
On

Its happen because you create resources directory on toolkit's directory which should not be there.

Readme.md in the newly generated package

This classic-specific directory can include any (if not all) of the following directories:

  • overrides: Any classes in this directory will be automatically required and included in the classic build. In case any of these classes define an Ext JS override (using Ext.define with an "override" property), that override will in fact only be included in the build if the target class specified in the "override" property is also included.

  • sass: Any classic-specific style rules should reside in this package, following the same structure as the directory in the package root (see package.json for more information).

  • src: The classic-specific classes of this package should reside in this directory.

If you need resources separated by toolkit do it on package's root resources directory.