Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SPFx 1.9.1: Entry point of library component bundle is not /lib/index.js anymore #4570

Open
vman opened this issue Aug 31, 2019 · 1 comment

Comments

@vman
Copy link
Contributor

commented Aug 31, 2019

Category

  • Question
  • Typo
  • Bug
  • Additional article idea

Expected or Desired Behavior

For an SPFx library component bundle, the entry point in the config/config.json should be the /lib/index.js file:

"bundles": {
    "my-custom-library": {
      "components": [
        {
          "entrypoint": "./lib/index.js",
          "manifest": "./src/CustomOfficeUiFabricLibrary.manifest.json"
        }
      ]
    }
  },

Observed Behavior

In 1.8.2-plusbeta if a library component was created, the config/config.json had the bundle defined as:

"bundles": {
    "my-custom-library": {
      "components": [
        {
          "entrypoint": "./lib/index.js",
          "manifest": "./src/CustomOfficeUiFabricLibrary.manifest.json"
        }
      ]
    }
  },

Since 1.9.1 the bundle entrypoint is now the default exported class:

"bundles": {
    "my-custom-library": {
      "components": [
        {
          "entrypoint": "./lib/libraries/customOfficeUiFabric/CustomOfficeUiFabricLibrary.js",
          "manifest": "./src/libraries/customOfficeUiFabric/CustomOfficeUiFabricLibrary.manifest.json"
        }
      ]
    }
  },

So if we add any more components to the library like this:

image

and then add the export to the index.ts file:

export { ButtonComponent } from './customFabric/ButtonComponent';

The components does not get included in the final bundle because the bundle entry point is pointing to the default class.

Steps to Reproduce

Create a library component project with SPFx generator version 1.9.1 and observe the config/config.json file

Thanks for your contribution! Sharing is caring.

@msft-github-bot

This comment has been minimized.

Copy link
Collaborator

commented Aug 31, 2019

Thank you for reporting this issue. We will be triaging your incoming issue as soon as possible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.