All of the examples for Lightning Out, such as Use Lightning Components in Visualforce Pages shows that we need an app and a component. Is there a way to use just an app or just a component? Ideally, I'd like to just be able to write an App and not need the extra burden of a component as well.

Documented Example

    <apex:includeLightning />

    <div id="lightning" />

        $Lightning.use("c:lcvfTest", function() {
          { label : "Press Me!" },
          function(cmp) {
            // do some stuff

Ideally, I'd prefer if I could just create the app itself in createComponent or something, so that I don't need to have a small three-line application bundle just for the sake of bootstraping a component.

  • I've tried a few different configurations. What I think is happening is that the use function explicitly replaces whatever is in the body of the app with the new content generated in createComponent. May 25, 2017 at 22:12
  • @CasparHarmer Curiously, $Lightning.createComponent does create apps as well as components (which I proved via console logs), but I can't seem to get the app to render. Looks like I might have to deal with using both, but it seems like overkill, since we can't bundle components/apps together. We really need better source code organization. Apex Code has the same problem, but it seems like Lightning could have fixed this... and failed.
    – sfdcfox
    May 28, 2017 at 5:07
  • 1
    I think we need both. For sure we need app, because the ltng:outApp is need to bring it outside lightning. May 28, 2017 at 11:20

1 Answer 1


Yes, the small little Lightning app bundle is needed. Salesforce uses this "dependency app" to bundle all the transitive dependencies of the Lightning components.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .