0

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"
    ]
},
dev4.life
  • 53
  • 6
  • what types of file you use in both cases? I mean it’s a component in both cases or it json? if this is Json why it contain in classic directory, which must contains components? – pvlt Mar 11 '20 at 22:21
  • These are just test files so see what and where being output after build. The content of the files are just text string indicating path to the files. By the way, it looks like in the build directory the classic/resources/file.json overwrites resources/file.json.. All I'm looking is to separate package resources same way that app resources are separated. – dev4.life Mar 12 '20 at 14:28

1 Answers1

0

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.

pvlt
  • 1,843
  • 1
  • 10
  • 19