Skip to content

RequireJS Isolation for WebJars in Subprojects #39

@michaelahlers

Description

@michaelahlers

I'm trying to use the RequireJS support in subprojects, and I've run into a couple snags.

To start, org.webjars.play.RequireJS assumes the reverse router will live in a controllers package. I was able to come up with a copy that parameterizes that package name. However, I ran into another problem afterwards.

To prove my solution, I had one subproject's build.sbt depend on version X of a library, and the other subproject depend on version Y. Both end up loading version Y (the highest lexigraphically) as org.webjars.WebJarAssetLocator makes no distinction by project. Worse, if I remove the dependency from either project, both still have access.

My guess is this isn't easily solvable with Play's classloading (i.e., I can't spot any straight-forward way to give WebJarAssetLocator a kind of scope for discovery). That said, if this team has any ideas that could make this possible, I'm all ears.

If it'll help, I'll be happy to assemble a sample project.

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