Question

I upgraded an old SPFx project from version 1.0.0 to 1.2.0 (most core libs in "package.json"). With this update the schema of the "config.json" changed. One of the changes is concerning me.

Previously, for components of the SPFx solution, you could specify the outputPath like this in "config.json":

"entries": [
  {
    "entry": "...",
    "manifest": "...",
    "outputPath": "./dist/hello-world.bundle.js"
  }   ],

Now the schema version 2.0 changed this to:

"bundles": {
    "hello-world": {
        "components": [
            {
                "entrypoint": "...",
                "manifest": "..."
            }
        ]
    }
},

Notice the missing ".bundle" part in the newer version? In fact, the output file name is not specified at all.

Here's the file the old schema version produced:

hello-world.bundle.js

And here's the new version:

hello-world.js (The '.bundle' part is missing.)

My question: is this intentional? Is this correct? Since deep in the SPFx libs there is still code checking for '.bundle' e.g. to change the color of those files in the console to green when serving from the local workbench.

Since in SPFx sometimes is magic involved depending on those special file endings (like with ".module.scss" files) I'm courious if I'm in for future problems.

Was it helpful?

Solution

Your code is correct. Best, you can compare it to a new project created using the latest version of the SharePoint Framework Yeoman generator. You will find exactly what you have: no .bundle in config.json and no .bundle in the generated bundle file, and all working as expected.

Licensed under: CC-BY-SA with attribution
Not affiliated with sharepoint.stackexchange
scroll top