You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The default excludeFilter that sbt-uglify sets causes it to skip files in the web-modules directory. As I understand it, this is in an attempt to avoid uglifying files uncompressed from webjars.
Aside from notmatchinghowother sbt-web plugins set the excludeFilter by default, this breaks having assets in the Play Framework from about 2.4.x onwards. (Possibly earlier, but I haven't seen anything indicating this is the case.)
As of about 2.4.x, submodule asset jars no longer get included in distributions. This is because the Play Framework uses ClassLoaders, and so having multiple asset jars might cause conflicts (see here)
To solve this, submodule assets get pulled in to the asset pipeline as if they are a webjar in the main project, and must be processed as if they are webjars. As a result, the default filter ignores these files and causes them to go unminified.
A workaround for people encountering such issues is to assign the following in your build.sbt...
excludeFilter in uglify :=HiddenFileFilter
... but perhaps the default excludeFilter should be changed to do this instead?
The text was updated successfully, but these errors were encountered:
iadcode
changed the title
default excludeFilter breaks having assets in submodules in Play Framework 2.4.x
Default excludeFilter breaks having assets in submodules in Play Framework 2.4.x
Apr 20, 2016
The default excludeFilter that sbt-uglify sets causes it to skip files in the web-modules directory. As I understand it, this is in an attempt to avoid uglifying files uncompressed from webjars.
Aside from not matching how other sbt-web plugins set the excludeFilter by default, this breaks having assets in the Play Framework from about 2.4.x onwards. (Possibly earlier, but I haven't seen anything indicating this is the case.)
As of about 2.4.x, submodule asset jars no longer get included in distributions. This is because the Play Framework uses ClassLoaders, and so having multiple asset jars might cause conflicts (see here)
To solve this, submodule assets get pulled in to the asset pipeline as if they are a webjar in the main project, and must be processed as if they are webjars. As a result, the default filter ignores these files and causes them to go unminified.
A workaround for people encountering such issues is to assign the following in your
build.sbt
...... but perhaps the default excludeFilter should be changed to do this instead?
The text was updated successfully, but these errors were encountered: