Flatten build directory structure in React Build Folder

Viewed 166

Im wondering if there is a way to completely flatten the folder structure within the build directory of a create-react-app. Im attempting to do a quick port over of my app onto a sharepoint site but the sharepoint site does not play well with the static/ folder and its children folders such as css/, js/, and media/ is there a way to do a npm run build such that the paths created are all within the same folder?

for example the asset-manifest.json currently shows files like this

{
  "files": {
    "main.css": "./static/css/main.ad49c970.chunk.css",
    "main.js": "./static/js/main.bfd3a96b.chunk.js",
    "main.js.map": "./static/js/main.bfd3a96b.chunk.js.map",
    "runtime-main.js": "./static/js/runtime-main.c0915b68.js",
    "runtime-main.js.map": "./static/js/runtime-main.c0915b68.js.map",
    "static/css/2.d9ad5f5c.chunk.css": "./static/css/2.d9ad5f5c.chunk.css",
    "static/js/2.3c65d00b.chunk.js": "./static/js/2.3c65d00b.chunk.js",
    "static/js/2.3c65d00b.chunk.js.map": "./static/js/2.3c65d00b.chunk.js.map",
    "index.html": "./index.html",
    "precache-manifest.8fc2b5edb6f6029051530a49398ae5c2.js": "./precache-manifest.8fc2b5edb6f6029051530a49398ae5c2.js",
    "service-worker.js": "./service-worker.js",
    "static/css/2.d9ad5f5c.chunk.css.map": "./static/css/2.d9ad5f5c.chunk.css.map",
    "static/css/main.ad49c970.chunk.css.map": "./static/css/main.ad49c970.chunk.css.map",
    "static/js/2.3c65d00b.chunk.js.LICENSE.txt": "./static/js/2.3c65d00b.chunk.js.LICENSE.txt",
    "static/media/logo.svg": "./static/media/logo.5d5d9eef.svg"
  },
  "entrypoints": [
    "static/js/runtime-main.c0915b68.js",
    "static/css/2.d9ad5f5c.chunk.css",
    "static/js/2.3c65d00b.chunk.js",
    "static/css/main.ad49c970.chunk.css",
    "static/js/main.bfd3a96b.chunk.js"
  ]
}

Ideally I just want everything under the root/ folder without static/js/ etc.

0 Answers
Related