Skip to content

Allow “import”ing view engines. #4593

Closed

Description

@issuefiler

express/lib/view.js

Lines 80 to 81 in 5c4f3e7

// default engine export
var fn = require(mod).__express

I import view engines, configure them with the imported instances,

then Express requires them, creating new clones of them, and they, the require’d instances that are in use, end up unconfigured.

See bgub/eta#113.

Activity

  1. dougwilson commented on May 17, 2021

    @dougwilson
    Contributor

    Hi @issuefiler Express will only require a view module if you didn't provide your existing instance to Express. If the view engine you are importing and configuring relies of some kind of state to be maintained, it is recommended to provide the view engine instance to Express directly instead of relying on the auto-require feature.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions