Skip to content

Built in support for including common Webpack plugins into the build fails silently, excluding the plugin from the build #2471

@deneboulton

Description

@deneboulton

Description

Modular Scripts includes built in support for checking if Webpack plugins for two popular dependencies used in JP - @finos/perspective and react-monaco-editor - are also available in the build.

If a dependency is found, but a plugin is not the build warns about this. If both dependency and plugin are found then the build script wants to instantiate the plugin and add it to the Webpack Config.

Observed in a cjs build execution.

Expected

Associated plugins when found are included in the Webpack Config.

If at the stage of including the plugin there is a failure then the greater build fails and the issue is messaged to the user.

Actual

When a plugin is available we incorrectly identity the entity that is the constructor from the plugin package.
An error is thrown.
No log message is output.
The build continues, silently swallowing the issue. The build, if it continues to be successful, will output artifacts that have not been influenced by the plugin.

Issue resides here, where we inadvertently use the outcome of this as a constructor.

Issue is not present in some older versions of modular-scripts, e.g., 3.6.0, it looks like it was introduced when the build script was transitioned to .ts from .js.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions